-
Notifications
You must be signed in to change notification settings - Fork 97
Let's have a real conversation #6
Comments
Chances are pretty slim for these proposal to make into V8 if they are not made part of ECMA262 standard through TC39. I'm pretty sure this applies to ChakraCore too. It sounds like you want a different language with other design goals. How about Java, Go, or Dart? |
@hashseed "I'm sure many of us use Node.js day to day due to obligations work related." Seems like more bureaucratic bullshit is required in order to get any shit done in the Open Source world. Good thing I don't really participate in any of it, thought this would be an opportunity to write something meaningful for the community. Thanks for informing me though. |
V8 is open source, so you can definitely fork it too. I'm just saying that you won't be able to get these changes into upstream V8. |
@hashseed then what is the point of even forking it if no one else is going to use it. I'd rather just use Elixir and C/++ at that point. I don't even have 100 followers on Github and not even 1k followers on Facebook. Not sure how anything I produce would gain any traction whatsoever. Just kind of reality you know? I've spent enough time doing similar things living in my own bubble. No need to spend time engineering things that don't really benefit me (but could benefit a lot of other people... technically the entire internet... but hey... Politics is politics). |
Remember the days when every browser had its own flavor of JavaScript? That's what you are proposing, essentially. |
@hashseed I proposed it to be the new standard. That's a little different. However, no one wants it to be a standard. Therefore, I have no interest in pursuing it, because I would literally be living in my own bubble. You're part of the core Chromium and V8 team so you know how the political system works there. Pretty sure I won't be able to get anything meaningful done for the project if this is the kind of response I get. |
🤣 |
Fwiw, threading in the form of standard (Web)Workers is something I’ve been wanting to approach anyway in Node.js. Also, while I agree with what @hashseed is saying here, I think it’s also worth mentioning that the amount of technical work required to affect language features is huge compared to the work just going on working on Node; so: If you want to change the language via forking, it’s likely better to start with a fork of a JS engine, not a fork of Node. |
@ChrisCates The repo was locked down for 24h due to spam in some other threads, as far as I can tell what you are saying in this edit is not the case. |
Adding dynamic type inference to the language would be an enormous amount of work. Like tens of thousands of human hours. It's not really reasonable to expect a small team of people just using a JS virtual machine to have the capacity to make this change on their own. You could take it to TC39 or try to build it yourself. Threading is reasonably possible, though still quite a bit of work. There was prior effort to get web workers into Node.js, so we could probably take that and finish it. I get what you're saying about atomic operations and low-level data structures, but those are systems-y things, and JS is just not meant for that. JS and ayo are intended more for app development purposes than systems development. |
Currently when running the test without an internet connection there are two JavaScript test failures and one cctest. The cctest only fails on Mac as far as I know. (I've only tested using Mac and Linux thus far). This commit moves the two JavaScript tests to test/internet. The details for test_inspector_socket_server.cc: [ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost make[1]: *** [cctest] Segmentation fault: 11 make: *** [test] Error 2 lldb output: [ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost Process 63058 stopped * thread #1: tid = 0x7b175, 0x00007fff96d04384 * libsystem_info.dylib`_gai_simple + 87, queue = * 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, * address=0x0) frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87 libsystem_info.dylib`_gai_simple: -> 0x7fff96d04384 <+87>: movw (%rdx), %ax 0x7fff96d04387 <+90>: movw %ax, -0x2a(%rbp) 0x7fff96d0438b <+94>: movq %r13, -0x38(%rbp) 0x7fff96d0438f <+98>: movq 0x18(%rbp), %rcx (lldb) bt * thread #1: tid = 0x7b175, 0x00007fff96d04384 * libsystem_info.dylib`_gai_simple + 87, queue = * 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, * address=0x0) * frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87 frame #1: 0x00007fff96cfe98b libsystem_info.dylib`search_addrinfo + 179 frame #2: 0x00007fff96cfafef libsystem_info.dylib`si_addrinfo + 2255 frame #3: 0x00007fff96cfa67b libsystem_info.dylib`getaddrinfo + 179 frame #4: 0x00000001017d8888 cctest`uv__getaddrinfo_work(w=0x00007fff5fbfe210) + 72 at getaddrinfo.c:102 frame #5: 0x00000001017d880e cctest`uv_getaddrinfo(loop=0x000000010287cb80, req=0x00007fff5fbfe1c8, cb=0x0000000000000000, hostname="nodejs.org", service="0", hints=0x00007fff5fbfe268) + 734 at getaddrinfo.c:192 frame #6: 0x000000010171f781 cctest`node::inspector::InspectorSocketServer::Start(this=0x00007fff5fbfe658) + 801 at inspector_socket_server.cc:398 frame #7: 0x00000001016ed590 cctest`InspectorSocketServerTest_FailsToBindToNodejsHost_Test::TestBody(this=0x0000000105001fd0) + 288 at test_inspector_socket_server.cc:593 I'm not sure about the exact cause for this but when using a standalone c program to simulate this it seems like when the ai_flags `AI_NUMERICSERV` is set, which is done in inspector_socket_server.cc line 394, the servname (the port in the FailsToBindToNodejsHost test) is expected to be a numeric port string to avoid looking it up in /etc/services. When the port is 0 as is it was before this commit the segment fault occurs but not if it is non-zero. PR-URL: nodejs/node#16255 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Currently when running the test without an internet connection there are two JavaScript test failures and one cctest. The cctest only fails on Mac as far as I know. (I've only tested using Mac and Linux thus far). This commit moves the two JavaScript tests to test/internet. The details for test_inspector_socket_server.cc: [ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost make[1]: *** [cctest] Segmentation fault: 11 make: *** [test] Error 2 lldb output: [ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost Process 63058 stopped * thread #1: tid = 0x7b175, 0x00007fff96d04384 * libsystem_info.dylib`_gai_simple + 87, queue = * 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, * address=0x0) frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87 libsystem_info.dylib`_gai_simple: -> 0x7fff96d04384 <+87>: movw (%rdx), %ax 0x7fff96d04387 <+90>: movw %ax, -0x2a(%rbp) 0x7fff96d0438b <+94>: movq %r13, -0x38(%rbp) 0x7fff96d0438f <+98>: movq 0x18(%rbp), %rcx (lldb) bt * thread #1: tid = 0x7b175, 0x00007fff96d04384 * libsystem_info.dylib`_gai_simple + 87, queue = * 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, * address=0x0) * frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87 frame #1: 0x00007fff96cfe98b libsystem_info.dylib`search_addrinfo + 179 frame #2: 0x00007fff96cfafef libsystem_info.dylib`si_addrinfo + 2255 frame #3: 0x00007fff96cfa67b libsystem_info.dylib`getaddrinfo + 179 frame #4: 0x00000001017d8888 cctest`uv__getaddrinfo_work(w=0x00007fff5fbfe210) + 72 at getaddrinfo.c:102 frame #5: 0x00000001017d880e cctest`uv_getaddrinfo(loop=0x000000010287cb80, req=0x00007fff5fbfe1c8, cb=0x0000000000000000, hostname="nodejs.org", service="0", hints=0x00007fff5fbfe268) + 734 at getaddrinfo.c:192 frame #6: 0x000000010171f781 cctest`node::inspector::InspectorSocketServer::Start(this=0x00007fff5fbfe658) + 801 at inspector_socket_server.cc:398 frame #7: 0x00000001016ed590 cctest`InspectorSocketServerTest_FailsToBindToNodejsHost_Test::TestBody(this=0x0000000105001fd0) + 288 at test_inspector_socket_server.cc:593 I'm not sure about the exact cause for this but when using a standalone c program to simulate this it seems like when the ai_flags `AI_NUMERICSERV` is set, which is done in inspector_socket_server.cc line 394, the servname (the port in the FailsToBindToNodejsHost test) is expected to be a numeric port string to avoid looking it up in /etc/services. When the port is 0 as is it was before this commit the segment fault occurs but not if it is non-zero. PR-URL: nodejs/node#16255 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Just a note: I've been banned from Ayo.js for no reason specified other than my comments (but this was not even directly said to me) and find this entire situation extremely ironic considering the entire purpose of this Ayo.js fork to begin with was from bureaucracy in the Node.js community. The point of my proposal was because you intended on doing a fork and seemed like a good opportunity to ask for some MUCH needed design changes at the compiler level. Instead you ask me to "pick another language" when Javascript is literally embedded in our browsers... That kind of thinking is absurd. I wish I could boycott this especially given how community members act... But look at me now I'm on a browser...
I'm sure many of us use Node.js day to day due to obligations work related.
But let's actually solve problems with the core language design itself and not build off of the mediocre at best cost abstractions Javascript originated from.
Dynamic Type Inference
It's no surprise that types are god awful in Node.js. Whether you are casting from String to Integer and so forth. We don't even have the option between integers or unsigned integers. I think a simple pragmatic solution is to adopt a model similar to Golang where the compiler computes the type intelligently and we can also verbosely define types. Typescript kind of amplifies the problem with types by explicitly defining things as
number
orstring
as opposed to more granular types that are given in other languages.Threading... beyond barely usable mutex like functionality.
I don't even think it's possible to utilize semaphore like primitives in Node.js. I believe there are some GYP implementations in the NPM ecosystem... However, proper threading management is pretty damn important. Especially if we want to build robust frameworks. Perhaps we can even adopt compiler logic like Erlang's or Rust's where we automatically utilize all threads for any computation.
Atomic Operations
Another huge problem with Node.js is the inability to utilize Atomic Operations. These are pretty important for critical computations. And Node.js kind of throws the entire idea of atomic computations out the window. This is a big reason why a viable database can't be built in Node.js due to lack of atomicity and inability to adhere to ACID compliance.
Improving bad cost abstractions
This goes beyond the async model in general... But rather... A lot of the core design of Javascript itself. For example we can't even utilize stacks or heaps in the native standard library. I could go on. But this can be improved by orders of magnitude to where it is now. Would be interesting to adopt data structures like Ring Buffers, Linked Lists and Double Ended Queues in the native library. Especially if we optimized abstractions in the assembly logic. I would be especially happy if we can utilize a lot of different graph techniques in the standard library... But that may be veering off more into a MATLAB approach to language design, but worth discussing anyway.
The text was updated successfully, but these errors were encountered: