Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Eggbertx

1
Actually, it looks like it does show a problem if you declare a variable with let twice, but not with var.
2
I'm not sure about duplicate definitions, but it does, but there is a section that shows problems with your code.
3
Definitely. And it has a lot of plugins that make it even better, like a live Markdown preview pane, or various language-specific extensions. I don't know if you noticed, but it also has a built-in terminal that defaults to bash in Linux (and presumably macOS) and Powershell in Windows.
4
Editor Development / Re: The Sphere Studio v1.2.1
Instead of changing the background color based on priority, why don't you create an icon for each?
5
Atom is nice, but I always felt like VS Code is a bit snappier and has less cruft. Which is surprising, considering the developer :P
6
I was actually thinking of creating a random map generator at one point as well, but I have too many other projects and things that need attending to to get around to it.
I think a general class for doing general operations on maps would be nice as well, possibly with load and save functions.
7
I somehow never noticed that hoisting behavior. I always always (almost) always declare my variables at the beginning of the script or source file, immediately after the imports, aside from temporary variables in if/for blocks, and to avoid confusion, I generally don't use those temporary variable names outside of those blocks. I just tested that with
Code: (javascript) [Select]
var a = true;
if(a) {
var b = 43;
let c = 44;
}
console.log(b); // 43
console.log(c); // error
and I see what you mean now. That doesn't make any logical sense why the above code is the way it is.
8
I'll probably make a poll or something when this gets off the ground and I can confirm that it's going to replace QtSphere IDE. If that is the case, should I just lock this thread and make a new one? Or can a mod split this thread, starting at my first post about electron?

One thing I like about ES6 is that if you do this:

Code: (javascript) [Select]
let pig = 812;
/* .......... */
let pig = 1208;

You get a runtime error.  Also modules are strict mode by default so if you forget to declare a variable that's an error too.  It's still indeed nice if the IDE catches it first, though. :)
Honestly, I've never really used lets, just because I never saw much of a point in them. With the errors, that should be something that the programmer is responsible for, shouldn't it?

Also nice: let is block-scoped, like in C, and the variable is not hoisted so if you use it before the declaration, you *also* get a runtime error.  The JS community has given that phenomenon a name: the variable is said to be in the "temporal dead zone".  Pretty goofy, huh? :P
So it treats it like use strict? And how is it goofy? Is "temporal dead zone" a reference to something?
9
Engine Development / Re: miniSphere 4.8.5
Here is valgrind's output of the 4.8.4 release
Code: [Select]
==3468== Conditional jump or move depends on uninitialised value(s)
==3468==    at 0x4C32EA6: rawmemchr (vg_replace_strmem.c:1402)
==3468==    by 0x67DA391: _IO_str_init_static_internal (strops.c:41)
==3468==    by 0x67CDB66: vsscanf (iovsscanf.c:40)
==3468==    by 0x67C82D6: sscanf (sscanf.c:32)
==3468==    by 0xF547E4A: ??? (in /usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0)
==3468==    by 0xF548182: ??? (in /usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0)
==3468==    by 0xF54BBF8: drmGetDevice (in /usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0)
==3468==    by 0x94932D6: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0)
==3468==    by 0x9492694: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0)
==3468==    by 0x9466988: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0)
==3468==    by 0x9461F10: glXQueryVersion (in /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0)
==3468==    by 0x5D470B8: ??? (in /usr/lib/x86_64-linux-gnu/liballegro.so.5.2.2)
==3468==
(Now I press Escape, select Exit and...)
==3468== Invalid read of size 4
==3468==    at 0x1902DE: image_unref (image.c:272)
==3468==    by 0x1A9A64: screen_free (screen.c:145)
==3468==    by 0x112797: shutdown_engine (main.c:484)
==3468==    by 0x111BFD: main (main.c:167)
==3468==  Address 0x2a10e590 is 0 bytes inside a block of size 112 free'd
==3468==    at 0x4C2CDDB: free (vg_replace_malloc.c:530)
==3468==    by 0x190369: image_unref (image.c:282)
==3468==    by 0x1A81D2: js_Surface_finalize (pegasus.c:4095)
==3468==    by 0x149B46: duk__handle_call_inner (duk_js_call.c:1619)
==3468==    by 0x14906F: duk_handle_call_unprotected (duk_js_call.c:1149)
==3468==    by 0x1185B9: duk_call (duk_api_call.c:60)
==3468==    by 0x13A10B: duk__finalize_helper (duk_heap_finalize.c:368)
==3468==    by 0x14AAA4: duk__handle_safe_call_inner (duk_js_call.c:2131)
==3468==    by 0x14A91B: duk_handle_safe_call (duk_js_call.c:1972)
==3468==    by 0x118928: duk_safe_call (duk_api_call.c:228)
==3468==    by 0x13A18A: duk_heap_run_finalizer (duk_heap_finalize.c:430)
==3468==    by 0x139903: duk__free_run_finalizers (duk_heap_alloc.c:206)
==3468==  Block was alloc'd at
==3468==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==3468==    by 0x18F787: image_new (image.c:69)
==3468==    by 0x1A98DB: screen_new (screen.c:100)
==3468==    by 0x111E9D: main (main.c:227)
==3468==
==3468== Invalid write of size 4
==3468==    at 0x1902E7: image_unref (image.c:272)
==3468==    by 0x1A9A64: screen_free (screen.c:145)
==3468==    by 0x112797: shutdown_engine (main.c:484)
==3468==    by 0x111BFD: main (main.c:167)
==3468==  Address 0x2a10e590 is 0 bytes inside a block of size 112 free'd
==3468==    at 0x4C2CDDB: free (vg_replace_malloc.c:530)
==3468==    by 0x190369: image_unref (image.c:282)
==3468==    by 0x1A81D2: js_Surface_finalize (pegasus.c:4095)
==3468==    by 0x149B46: duk__handle_call_inner (duk_js_call.c:1619)
==3468==    by 0x14906F: duk_handle_call_unprotected (duk_js_call.c:1149)
==3468==    by 0x1185B9: duk_call (duk_api_call.c:60)
==3468==    by 0x13A10B: duk__finalize_helper (duk_heap_finalize.c:368)
==3468==    by 0x14AAA4: duk__handle_safe_call_inner (duk_js_call.c:2131)
==3468==    by 0x14A91B: duk_handle_safe_call (duk_js_call.c:1972)
==3468==    by 0x118928: duk_safe_call (duk_api_call.c:228)
==3468==    by 0x13A18A: duk_heap_run_finalizer (duk_heap_finalize.c:430)
==3468==    by 0x139903: duk__free_run_finalizers (duk_heap_alloc.c:206)
==3468==  Block was alloc'd at
==3468==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==3468==    by 0x18F787: image_new (image.c:69)
==3468==    by 0x1A98DB: screen_new (screen.c:100)
==3468==    by 0x111E9D: main (main.c:227)
==3468==
==3468== Invalid read of size 4
==3468==    at 0x1902ED: image_unref (image.c:272)
==3468==    by 0x1A9A64: screen_free (screen.c:145)
==3468==    by 0x112797: shutdown_engine (main.c:484)
==3468==    by 0x111BFD: main (main.c:167)
==3468==  Address 0x2a10e590 is 0 bytes inside a block of size 112 free'd
==3468==    at 0x4C2CDDB: free (vg_replace_malloc.c:530)
==3468==    by 0x190369: image_unref (image.c:282)
==3468==    by 0x1A81D2: js_Surface_finalize (pegasus.c:4095)
==3468==    by 0x149B46: duk__handle_call_inner (duk_js_call.c:1619)
==3468==    by 0x14906F: duk_handle_call_unprotected (duk_js_call.c:1149)
==3468==    by 0x1185B9: duk_call (duk_api_call.c:60)
==3468==    by 0x13A10B: duk__finalize_helper (duk_heap_finalize.c:368)
==3468==    by 0x14AAA4: duk__handle_safe_call_inner (duk_js_call.c:2131)
==3468==    by 0x14A91B: duk_handle_safe_call (duk_js_call.c:1972)
==3468==    by 0x118928: duk_safe_call (duk_api_call.c:228)
==3468==    by 0x13A18A: duk_heap_run_finalizer (duk_heap_finalize.c:430)
==3468==    by 0x139903: duk__free_run_finalizers (duk_heap_alloc.c:206)
==3468==  Block was alloc'd at
==3468==    at 0x4C2DBC5: calloc (vg_replace_malloc.c:711)
==3468==    by 0x18F787: image_new (image.c:69)
==3468==    by 0x1A98DB: screen_new (screen.c:100)
==3468==    by 0x111E9D: main (main.c:227)
==3468==
10
Editor Development / Re: The Sphere Studio v1.2.1
On an unrelated note, .NET's dialog box for uncaught exceptions seems kind of mystical to me.  Normally when an exception is thrown, it unwinds the stack until it finds a catch{} block to handle it; if there is no catch{}, then the stack completely unwinds and the program crashes.  .NET apps instead show that dialog box which terminates the operation in progress but somehow the app keeps running.  I can't understand how that works--does the runtime just unwind the function that threw the exception?  And if so, what gets returned to the caller?  By all means something like that should never work... and yet it does. :hushed: 
It could be some kind of threading thing, something in .NET that isn't exposed to a program developer.
11
Damn, it looks like the embedded browser can't execute JavaScript. Looks like it's back to electron then.
12
Engine Development / Re: miniSphere 4.8.4
Code: [Select]
==2047== Memcheck, a memory error detector
==2047== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==2047== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==2047== Command: minisphere
==2047==
Out of Memory
==2047==
==2047== Process terminating with default action of signal 6 (SIGABRT)
==2047==    at 0x8EC3FCF: raise (raise.c:51)
==2047==    by 0x8EC53F9: abort (abort.c:89)
==2047==    by 0x60EC165: _GLOBAL__sub_I_RecyclerWriteBarrierManager.cpp (in /usr/lib/libChakraCore.so)
==2047==    by 0x400F8A9: call_init.part.0 (dl-init.c:72)
==2047==    by 0x400F9BA: call_init (dl-init.c:30)
==2047==    by 0x400F9BA: _dl_init (dl-init.c:120)
==2047==    by 0x4000C59: ??? (in /lib/x86_64-linux-gnu/ld-2.24.so)
==2047==
==2047== HEAP SUMMARY:
==2047==     in use at exit: 86,856 bytes in 262 blocks
==2047==   total heap usage: 312 allocs, 50 frees, 96,876 bytes allocated
==2047==
==2047== LEAK SUMMARY:
==2047==    definitely lost: 0 bytes in 0 blocks
==2047==    indirectly lost: 0 bytes in 0 blocks
==2047==      possibly lost: 1,800 bytes in 19 blocks
==2047==    still reachable: 85,056 bytes in 243 blocks
==2047==                       of which reachable via heuristic:
==2047==                         newarray           : 1,536 bytes in 16 blocks
==2047==         suppressed: 0 bytes in 0 blocks
==2047== Rerun with --leak-check=full to see details of leaked memory
==2047==
==2047== For counts of detected and suppressed errors, rerun with: -v
==2047== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Killed
13
Engine Development / Re: miniSphere 4.8.4
I reinstalled Debian again just to be sure that I hadn't installed any extra packages that could be interfering and installed LXDE, and after the CD installation was done, I booted into it, logged in, and ran apt install git liballegro5-dev libmng-dev, which installed gcc and all the dependencies. Then I cloned the minisphere, ran make and make install, then I ran minisphere and still had the same issue when I exited out of that.
14
By searching around the internet and peeking through the API, I'm fairly certain by now that Code doesn't provide anything like I described. It does make it possible to embed a browser, so I still might be able to make an extension for Sphere editing
15
@Fat Cerberus I asked about VS Code and drawing/mouseclick events on StackOverflow. If I get a good lead and it turns out that it isn't too difficult, I'll just make a plugin or plugins. If not, I'll probably go back to the electron plan. It sucks that all the time spent with Qt was wasted, but I had been meaning to learn more C++ anyway so I guess it wasn't a total loss, even if that might be a little selfish.