News for hackers. Stuff that matters.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by irregularexp on Wednesday January 06, 2016 @06:19AM (#10849889)
A little off-topic, but I figured the people reading the comments here would be the best place to ask. Why use JavaScript on the server at all? I've developed on both the front end and back end, and written non-trivial server-side code in a number of languages, and I don't see any use-case where JavaScript is "best-in-class." It seems like whether you're aiming for ease/speed of prototyping, pure performance, a good concurrency model, or... any other task I can think of, there's a better tool for the job. There seems to be a decent number of people and companies using Node, though, so let me know what I'm missing!
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @06:53AM (#10850008)
- Yes there are better tools individually for prototyping, perf, concurrency ... but Node does pretty well on all this points, so it's arguably a strong all rounder

- Node's package manager npm is fantastic, and (imo) gets package management more right than 90% of other package managers

- There are 1000s of high quality actively maintained modules on npm to get you started on things (and 1000s of garbage ones, so you have to be careful)

- The "holy grail" web app architecture (server rendering of frontend JS components coupled with client side rendering in a SPA) is only possible by running some JS on the server

- Sharing JS UI components between the backend and frontend is a huge DX and productivity win

- Another huge maintenance win is using the same language across the whole stack (frontend, backend and devops/automation)

- With ES6, JS is slowly turning into a pretty cute language, check it out :)

- A nice level of cross-pollination between JS and those geniuses in the ClojureScript community is bringing some really nice functional programming approaches and projects to Node/JS

- You can use Node and JS to compile to both native desktop apps and native mobile apps. Having a centralised UI library of JS components that you can leverage for your desktop app, mobile app, frontend SPA and backend static rendering sounds pretty good to me!

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by yulaow on Wednesday January 06, 2016 @07:08AM (#10850048)
I would just like to disagree on the "high quality" of modules. Personally I worked for a year in a very long lasting project about a specific type of social network. In the team I was the first one to push for the use of nodejs, react and mongo and... my god if I regretted it.

The quality of node package is very bad in general. Like the most part are totally garbage. I don't know from where you come and what you used before, I worked only with java, php and ruby for the backend and in those i found:

- far higher Documentation quality... like, node modules documentation is not even REMOTELY comparable: it is often extremely outdated, with very poor examples, the most of the times these example are not even working or are using functions deprecated since 3-4 versions of the module itself.

- a infinite amount of bugs and undocumented behaviors rarely already reported and, when reported, just ignored for months. I usually would find infinite workarounds instead of solutions

- extreme use of "I can do it better, so here my fork". I passed the big part of the time running from bug report to bug report and reading in the comments discussions about "The main maintainer of this package does not want to solve this problem of mine... so i made this other module, totally identical to this one but I just added this little hack, which totally broke the standard way of doinf things of this module, some functionalities I needed and never implemented the last 8-9 months of commits here." and chain this. Like this happened a dozen time each months when someone suggested "Why we don't try this module that says it solve our needs?"

- No standards anywhere.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @07:18AM (#10850080)
Maybe your team chose bad modules? You seem to know what a bad module looks like (bad docs, bugs, many forks, hanging PRs, undocumented behaviour), so why did your team use ones like that?

It's true, you have to be careful ... there are so many npm modules that there are many garbage ones too. But there are many very high quality ones too. Be more careful about how you choose one, and if you can't find a good one for your needs, then don't settle for a bad one - roll the feature yourself, or adjust the functionality of your app. But in my experience there are high quality modules available for the major components of apps.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by mgkimsal on Wednesday January 06, 2016 @08:42AM (#10850405)
> But there are many very high quality ones too.

Doesn't mean there are any 'high-quality' ones appropriate for the specific task.

> Be more careful about how you choose one, and if you can't find a good one for your needs, then don't settle for a bad one - roll the feature yourself, or adjust the functionality of your app.

So now you're just contributing to the problem of yet another package in the ecosystem?

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @09:14AM (#10850554)
> Doesn't mean there are any 'high-quality' ones appropriate for the specific task.

Yes, which is why I said if you can't find one then roll the feature yourself.

> So now you're just contributing to the problem of yet another package in the ecosystem?

Nope, I didn't say write and publish a npm module. I said "roll the feature yourself", meaning just write it privately for your app. Having lots of packages isn't bad for the ecosystem, it makes Node and npm unique and amazing. But picking bad npm modules, which is entirely avoidable, is bad for your project - that's all I meant.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by mgkimsal on Wednesday January 06, 2016 @03:50PM (#10853645)
> Having lots of packages isn't bad for the ecosystem, it makes Node and npm unique and amazing. But picking bad npm modules, which is entirely avoidable, is bad for your project - that's all I meant.

Having an ecosystem where, say, 70% of the choices I make can be 'bad' is probably not a great ecosystem. I hope it shakes out in the next year or so and there's less choice. There's enough choices I have to make in my own application layer - having to make X more choices about code I didn't write and how all those pieces fit together (and how they'll be maintained going forward) just doesn't feel like a good long-term platform. But... people have the 'choice' to use it if they want ;)

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Thursday January 07, 2016 @07:06AM (#10857464)
Reducing the friction to publishing portable inter-related code modules to the world to near zero like npm has is an incredible thing. Everyone is still trying to understand the ramifications. The downside is that there's more garbage on there, but believe me, restricting your choice of module to the 30% of high quality ones is a trivial task for a experienced dev. If you want to criticise the platform on the basis that inexperienced devs use it and mess up sometimes that's up to you, but it seems pretty reductive.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by angersock on Wednesday January 06, 2016 @02:20PM (#10852885)
I've heard a lot of observations about npm, but being unduly burdened with quality in package management has not yet been one of them!

Bundler and hex, for example, are faaaar better--just consider how long it took them to figure out shrinkwrapping, or flat structure to support Windows.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by JohnDotAwesome on Wednesday January 06, 2016 @10:54AM (#10851128)
As a developer, doesn't it make you _itch_ when you repeat yourself? Do you feel that itch when you repeat the same application logic on the server as you do on the client? Getting the client-side validation in-sync with the server validation? This is where JavaScript is fan-fucking-tastic.

All of my recent projects have been isomorphic react apps. I build my app like it were a fully client-side single page web app, but I get server rendering when there's a new http request. Once the page has rendered, the web app takes over and uses history pushState. There are very few pieces of code that aren't used in both places. Once you get the hang of it, you very naturally create mockable interfaces that can be swapped depending on environment.

In my opinion, this is pretty much the only category that makes JavaScript "Best-in-class"; It's the easiest language to build isomorphic web apps.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by brndn on Wednesday January 06, 2016 @11:36AM (#10851445)
What does your software stack look like for that?
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by JohnDotAwesome on Tuesday January 12, 2016 @09:39AM (#10887624)
Currently-

* Babel - ESNext - JSX * Gulp * Browserify - Incremental * Express * React router * Rolled my own flux - This was interesting because I didn't truly understand flux when I started - I _get it_ now

The routes on the server are the same routes on the client. When the server renders, React/ReactRouter take over on the client and use history pushState.

And that's actually about it. There aren't any other major libs that change the nature of the project.

One thing I'm looking to do next is get hot reloading working and to somehow cut down on the initial compile times.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by it_learnses on Wednesday January 06, 2016 @11:07AM (#10851224)
What are your thoughts on Meteor?
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by morenoh149 on Wednesday January 06, 2016 @11:29PM (#10855986)
good for prototypes. Just build your software.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by tzaman on Wednesday January 06, 2016 @06:25AM (#10849909)
One language to rule them all. There is no way to handle complex UIs in the browser without JavaScript. So while you absolutely need JS developers, why not make the API/backned in the same language so that you can hire additional developers that know the same language your existing employees already do. From an employer's perspective, it's easier to manage and (re-)allocate resources if need be.

JavaScript is becoming the web darling (or it already is?), whether we like it or not. And with some nice syntactic improvements ES6 brings, I don't mind.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by davedx on Wednesday January 06, 2016 @07:54AM (#10850204)
What I'm missing at our current place is being able to share business logic code between the client and server. Even simple things like validations that are run in both environments would be nice to not have to rewrite and maintain in two languages.

Meteor excels at this.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by johnnydoebk on Wednesday January 06, 2016 @10:26AM (#10850955)
> One language to rule them all. > JavaScript is becoming the web darling (or it already is?)

I wonder, will it be still as popular if WebAssembly let us use any programming language on the client? I mean post MVP WebAssembly with support of GC, DOM, and so forth.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by s_kilk on Wednesday January 06, 2016 @10:53AM (#10851120)
I suspect the Javascript-or-death crowd are a (vocal) minority of web developers. Most will jump at the chance to use whatever language they please in the browser.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by moonchrome on Wednesday January 06, 2016 @06:32AM (#10849933)
>There is no way to handle complex UIs in the browser without JavaScript

Dart, ClojureScript, TS (technically JS superset but still a considerable improvement) are just the ones I've used.

And I'd rather use both of them on server (Dart/Clojure) than JS.

There are other languages as well.

ES6 is a pain in the ass - no browser supports it and using transpilers + polyfills and the JS build/package tools to set that up is a PITA that only grows as you add dependencies and it bloats your code size to be comparable or larger than the compile-to-JS languages without making the language significantly better.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @06:44AM (#10849980)
Why is transpiling ES6 any more of a PITA than transpiling Clojurescript? ES6 to ES5 is a one shell command with Babel. And TS is ES6 but with type annotations. And ignore all of the myriad of high quality plain JS modules on npm at your peril. I like Dart and ClojureScript too, but I've really enjoyed working on ES6 and ES5 projects too. I don't doubt your Dart and ClojureScript credentials, but your comment betrays ignorance of ES6 and the plain JS ecosystem.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by moonchrome on Wednesday January 06, 2016 @07:12AM (#10850061)
>ES6 to ES5 is a one shell command with Babel.

You still need to include core.js to polyfil basically everything from standard library. And then you need to make sure Babel works with your framework (like Polymer or what not), and that's just the start of the interop hell that is using different JS libraries together. Rule of thumb - anything you add to your JS build system = increase in the likelihood of hair pulling when things break - and babel and core.js are two such things.

The value I get from ES6 compared to the CLJS change how much I'm willing to tolerate the PITA factor of the build system.

In dart I don't have to do any of that, just add few lines to pubspec.yaml with dependencies and transform directives and off I go. And every other library uses the same build system and the same package manager and the same standard library !

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by pfooti on Wednesday January 06, 2016 @12:07PM (#10851706)
I have not found that to be the case. I run my code through gulp-babel and done. There is no runtime AFAIK, although there was one for traceur.

I have also had no real problems interopping with other big libraries. I think the biggest point of discontinuity would be the class keyword vs other class-like libraries (like coffeescript's implementation). Even that's not too bad, I'm able to extend those using es6 class syntax, I just need to be careful about calling super and setting up the constructor properly.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by tzaman on Wednesday January 06, 2016 @06:39AM (#10849960)
Yeah, but what % of frontend developers use Dart, CS or TS? Not as big as you think. And no browser supports any of them, yet, including ES6. So you always have to transpile to vanilla JS, whether you use ES6 or ClojureScript.

Don't get me wrong I think all those experiments (if I may) are nice, but if I were to develop an interface in Dart/CS/TS today, I'd have serious problems hiring people that know one of those tomorrow.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by gisenberg on Wednesday January 06, 2016 @03:00PM (#10853263)
ES6 support in modern browsers is pretty okay (see: https://kangax.github.io/compat-table/es6/).

It doesn't eliminate the need to transpile, but it looks like transpiling may not be necessary forever.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by rhinoceraptor on Wednesday January 06, 2016 @08:45AM (#10850424)
ES6 is pretty straightforward. You use Browserify or Webpack with Babel, and set it up to build with Gulp or Grunt.

I don't see how using Dart, TS, etc. make it any asier, and with the setup I just described, you're using Javascript top to bottom. I have an Angular project set up this way, and that allows me to run the unit tests in Node on the command line.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by enkephalin on Wednesday January 06, 2016 @06:38AM (#10849958)
do you honestly believe that ES6 is not an improvement for javascript? if so, why?
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by moonchrome on Wednesday January 06, 2016 @07:00AM (#10850024)
It's an improvement - but at this point ES6 is just another compile-to-JS language that needs to ship it's own standard library - except it's worse than all of the mentioned ones (it has no type checking, standard library is still meh, semantics are still good old JS semantics).
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by krisdol on Wednesday January 06, 2016 @08:16AM (#10850296)
What do you mean it's a compile to js language? I use ES6 with no transpilers.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by TranquilMarmot on Wednesday January 06, 2016 @01:29PM (#10852459)
Same here; I guess it really depends on who your target market is. So far, all the ES6 I've written works just fine in Chrome, Firefox, Safari, Opera, and Edge. The only browser that breaks everything is Internet Explorer, but it seems like general consensus these days is that IE is only used in enterprise applications where you're locked into it.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by qwertyuiop924 on Wednesday January 06, 2016 @09:55AM (#10850763)
Where are all the people who like dynamic languages? Do they just hide while other people duke it out over this?

It just seems like everybody except me hates dynamism sometimes.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by EvanPlaice on Wednesday January 06, 2016 @12:11PM (#10851734)
I think ES6 is just in its in-between phase of adoption. The mainstream hasn't fully adopted it yet. As for the rest...

The Coffeescript converts have moved on from the 'one true language' now that ES6 cherry-picked most of the good parts and people started realizing that CS source maps are buggy/inconsistent.

Standards are for 'plebs' so they've moved on to the new shiney. By new shiney, I mean mimicing FP in Javascript and looking down on people who can't ELI5 monads and functors. Despite not being able to ELI5 monads and functors.

Typescript, is really geared toward OOP devs who live in an IDE and compulsively twitch an invisible set of CTRL-SPACE keys when they get nervous.

It's a well-known fact that Google is a OOP- heavy Java/C++ shop who have been developing algos in Java/C++ since their last CS course where they developed algos using Java/C++.

It's within their best interest to get all of there desktop devs to convert to writing desktop apps on the web before all that penis pills/local singles ad money runs out.

It's only a matter of time before we see the first JS AbstractFactoryFactoryServiceProvider class in the wild. Angular2 has made considerable progress on this front so far.

/satire

Honestly, I really enjoy ES6. The JS dev communities favorite past time is ragging on how ridiculously bad JS is. ES6 isn't bad so it's not worth talking about.

The new features introduced in ES6 are pretty conservative. They consist of good concepts poached directly from popular superset languages or sensible additions that fit in nicely with the usual JS style.

The really interesting additions are still in the specification phase. Additions, such as the new ES6 module and loader standard, decorators, native HTTP fetch, etc...

As long as new standards are being introduced, transpiling will continue to be a requirement. I think it's cool that people can create and use new supersets of JS. It beats having to listen to them whine about how 'Javascript isn't exactly like some other language that I really like to use.'

In a way it's the first democratic programming language. Instead of dictating what people should and shouldn't use, people are free to migrate around to different communities until they find one that more closely matches their worldview. Everybody follows the same baseline standard but there's a lot of legroom for differentiation.

Why axegrind over our differences when we can celebrate them and start working together.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by qwertyuiop924 on Thursday January 07, 2016 @08:24AM (#10857733)
Fair 'nuff. I probably fall into the "mimic FP" section above, as I REALLY like functional abstractions. Although I don't do much pure FP. And I don't look down on anybody who can't ELI5 monads and functors. Monads and functors are confusing.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by EvanPlaice on Wednesday January 13, 2016 @06:21PM (#10898456)
It's all good. My comment was more of a friendly jab than a direct criticism. I agree that FP concepts are amazing.

I just don't see the utility in trying to translate pure FP concepts directly to JS. Same goes for the Typescript folks with OOP abstractions and design patterns. It's like watching a pissed off New Yorker rant about how the pizza shops in LA suck. Live a little and try a California burrito. It might change your life.

The point being, neither approach has provides measurable benefit to runtime performance/stability. They're nothing but really complicated abstractions whose sole intent is to protect devs from themselves. Why don't we build better tools to assist devs instead of inventing yet-another-feature-specific-language?

I think FP abstractions translated to JS could work as amazingly useful design patterns. Hopefully, decorators will make it a lot less painful to define higher order functions in JS.

Likewise, static type alike languages are very useful as a bridge to traditional OOP devs. I think gradual typing is a better long term approach.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by qwertyuiop924 on Friday January 15, 2016 @11:43AM (#10910374)
...Don't you mean arrow functions? Decorators don't seem like they'd help with that.

And yeah, I don't think that monads are that useful JS. And OO is different in JS. Deal with it.

Also, if you use Strategy, Iterator, or Visitor patterns in JS by writing classes for said things, you deserve to be punched in the face really hard. Repeatedly.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by cantagi on Wednesday January 06, 2016 @06:34AM (#10849940)
That's not really an argument for writing server code in javascript, since you could instead find a way of transpiling your favourite language to javascript and use it on the client and server. I give you typescript, clojurescript, haste, and GHCJS as examples.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @06:46AM (#10849986)
That would depend a lot on the story for using npm modules in your favourite language and your transpiled code. If it's not possible, it's a non-starter.

And why would you write ClojureScript to use on the server, when you could just use Clojure?

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by wslh on Wednesday January 06, 2016 @06:54AM (#10850010)
I don't want to restart a flame war but after choosing NodeJS for some projects based on specific modules not available in other languages (e.g: bitcore*) I am moving away or leaving it for very specific tasks. The code we wrote more than one year ago making an SQL transaction in 8 statements with async is difficult to understand and have some implicit stuff that you need to take into account. The other problem is not having a multithreading environment (in the official release) because you may want to respond to new tasks instead of blocking the event loop. I have seen timeouts because of this. Even if the recommendation is to do simple tasks, you can't enforce this when using hundreds of third party modules.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Wednesday January 06, 2016 @07:06AM (#10850041)
With the up-most respect, and we've all been there, but I would submit that maybe you just didn't write your Node code very well? Written properly, async code shouldn't be hard to understand. And there are tons of ways to spin up a new process or worker to execute a task without blocking the event loop of the main app. I mean, I could go away and use my limited experience to write a small project in Python to do a specific task ... but if it turned out to have deficiencies I wouldn't blame Python, rather my limited experience. Next time you need something written in Node, why not hire a experienced Node dev? And what is this recommendation to do simple tasks? I never heard that :)
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by rco8786 on Wednesday January 06, 2016 @09:34AM (#10850650)
How did you manage to block the event loop? For all of JS's warts, the language makes it basically impossible to do this.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by wslh on Wednesday January 06, 2016 @11:20AM (#10851332)
If you use a module which uses longer cryptographic operations it is possible.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by rco8786 on Wednesday January 06, 2016 @12:55PM (#10852139)
OP said he was making a SQL transaction.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by wslh on Wednesday January 06, 2016 @09:14PM (#10855516)
Using bitcore*...
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by bottled_poe on Wednesday January 06, 2016 @06:42AM (#10849977)
If your developers only know JavaScript, they probably shouldn't be let anywhere near your backend. Any decent developer can rapidly pick up any other language.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by tzaman on Wednesday January 06, 2016 @06:47AM (#10849992)
I could not disagree more. Rapidly picking up any language is simply not possible (unless you're a genious). Because the language is not just the syntax; It's its history and evolution, design choices, documentation (or lack thereof), community (both kindness/aproachability and responsiveness), leadership, etc. It takes time. Which sometimes, as an employer, I'm not willing to invest in. Because money.

Plus you've somehow managed to state that JS developers are not decent enough.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by rdtsc on Wednesday January 06, 2016 @10:38AM (#10851028)
I wouldn't use it.

1) Bad concurrency model -- callbacks, promises and futures are in general inferior abstraction model compared to green threads, actors, regular threads. Performance-wise it might do well in some scenarios but you are forced to use a more complicated abstraction to get that performance It is not worth it. In general it is appealing because it looks simple in small demos, as applications grow it becomes a mess.

2) npm modules are easy to use and that's great. Good model (well maybe except for deep nesting which breaks based on max path in say Windows, but I hear they are fixing that). The problems I found was that a lot of modules were of low quality. Code half-finished, buggy, developer moved on to something else, etc. Somehow it seems more so than say in the Python community.

3) Javascript is not the best language. There is a reason there is a "Javascript: The Good Parts" book. Because there are lot of crazy decisions made in it originally and a lot of bad "parts". If there was a choice between FORTRAN, Cobol and Javascript. I would pick Javascript hands down, but there are other languages out there today.

However. If all you know is Javascript and you want to write a small demo, then go for it. It will be the least friction.

So with all this complaining and whining, how about some constructive stuff. What language / frameworks might be more interesting / better.

1) Go : good concurrency model, supported by a large community, good performance. Lots of big companies use it.

2) Elixir : new kid on the block, fun, one of the friendliest communities. Probably best concurrency model -- actors. It uses Erlang's VM, so that part is rock solid, battle tested for many years. But not as many libraries. But can use existing Erlang libraries from it. Also best for reliability and fault-tolerance.

3) Python : easy to learn, lots of libraries, lots of material how to use it. This is my go-to language to get stuff done quickly. Try Python 3 if you start from scratch.

4) Clojure, Scala, Java: run on JVM. Battle tested, probably lots of libraries. Personally not as familiar with it, most enterprise and big sites out there run on the JVM currently.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Tloewald on Wednesday January 06, 2016 @10:50AM (#10851093)
If you want to level constructive criticism, then set aside language prejudice. Obviously, if you don't like javascript, move on.

It's great you like Python. Use a Python framework. You can point out Javascript's warts and we can laugh at the Python 3 migration. (And really, both of these criticisms are out of date. Javascript is _fine_ these days and Python 3 is moving towards backwards compatibility; sure Javascript has warts, but that's because it's backwards-compatible. You know, like... never mind.)

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by rdtsc on Wednesday January 06, 2016 @11:10AM (#10851252)
> Obviously, if you don't like javascript, move on.

I don't like many things and like other things. All in various degrees. So I shared my experience.

But you seem to be interested in what I like, so I'll share more. I would say, in general I am not really a "$X language" developer. A lot of people say "Oh, I am a Java developer" or "A Node developers". I am not a Python developer, or Erlang developer. I am a developer who solves problems. And languages are tools ( so far I used Javascript in the past, as well as Erlang, Java, C++, C#, and yes, even FORTRAN ).

The point about Python was that currently, most tasks I had to do, were made quicker and easier by using Python. Some are solved better by Erlang, some by C#.

Javascript and Node I found had enough negatives so it seemed helpful to share that too.

> Obviously, if you don't like javascript, move on.

I didn't know this was Javascript land and I wasn't allowed to come in without proper credentials. (See note about "friendly community" regarding Elixir in my original post, that wasn't by accident. I didn't want to say anything more about Node community, but I will now -- yeah it is not the friendliest, lost of insecurity and angst in it, which was another turnoff to me personally).

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Wintamute on Thursday January 07, 2016 @06:51AM (#10857406)
From the inside it's extremely friendly, easy-going and supportive. (Not at all saying this is you) but the JS community also gets a lot of hate from backend devs looking down their noses at us, making comments probably based on that one time a few years ago they tried to write some frontend JS to fix a widget and had a bad time, while remaining largely ignorant of the state of modern, professional JS development. So yep, you're right, this makes us insecure and defensive sometimes when dealing with outsiders.

On the flip side, I can see why developers in other languages may feel a bit defensive too. They see this language that they have a poor opinion of start to eat into everything, including server side, and potentially threaten livelihoods. Its an emotionally charged area. JavaScript: The Good Parts is getting on for a decade old, things have changed so much. With ES2015 and beyond JS is becoming a pretty cute language, it's slowly starting to enable a really nice functional style, try and write a project or two in it sometime, see what you think :)

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by anatari on Wednesday January 06, 2016 @06:52AM (#10850003)
The one language to rule them all reasoning is a red herring. We chose nodejs for our server code for an iOS app as do many others.

The reason why JS + node is popular is becasue it's pretty good at each of the metrics you mentioned. Even though it's not best in class at any one of those, it is well balanced for many tasks. Many other technologies are either too slow, too low level, too hard to scale, or too cumbersome to work with.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by curun1r on Wednesday January 06, 2016 @12:05PM (#10851688)
Node is too often conflated with JavaScript. This is understandable, considering JavaScript is the interface between the developer and the platform. But as crazy as this might sound, JavaScript is an implementation detail of the Node platform, not a defining characteristic. For instance, there's a project [1] that replaces JavaScript in Node with Lua.

But if you go back to the origin story of Node, it's all about libev (though it now uses libuv for the same purpose) and that pervasively-asynchronous mindset. JavaScript was chosen as the developer interface because it met the need to support that asynchronous philosophy. The result is that everything in the Node world is asynchronous and asynchronous is the path of least resistance for the developer. Other platforms that weren't conceived with this mindset often force developers to fight to be asynchronous.

> It seems like whether you're aiming for ease/speed of prototyping, pure performance, a good concurrency model...

It's a mistake to look at JavaScript as a fit for all of this. Instead, you should consider how the Node platform fills the need. For easy of prototyping, it's not JavaScript that makes Node excel, it's npm. The only package management system I've found that I prefer to npm is Rust's Cargo. And npm is still well ahead of Cargo in the richness of the package ecosystem. For pure performance, you can always write a native Node addon [2]. And, as mentioned, while JavaScript isn't concurrent at all, the Node platform provides the concurrency model in a way that has proven to be scalable but without most of the pain that comes with writing concurrent code. Writing concurrent code is hard...that's not news. The Node framework make writing concurrent code significantly easier by creating abstractions that hide the the fact that code is concurrent.

I know it's bizarre to look at it this way, since you would be writing most of your application logic in JavaScript, but try to look at it as an implementation detail and consider the advantages of the Node platform and the ecosystem that surrounds it. When you take this perspective, Node becomes a lot more attractive than the JavaScript language is on its own.

[1] https://luvit.io/

[2] https://nodejs.org/api/addons.html

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by impostervt on Wednesday January 06, 2016 @08:23AM (#10850334)
I use it on the server because I like javascript.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by hitgeek on Wednesday January 06, 2016 @11:03AM (#10851190)
I think this is the correct answer.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by dbattaglia on Wednesday January 06, 2016 @07:30AM (#10850117)
At this point you can probably say choosing node/js is similar to why you would choose Ruby or Python or PHP for your backend, it's another scripting language that offers decent performance, a large ecosystem and good developer productivity. It really boils down to preference in syntax, tooling and ethos ("micro frameworks", "batteries included" or somewhere in between). At this point I'm so comfortable in JS that I can be very productive in Node compared to the ramp up time I would require for Rails, django etc.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by dev360 on Wednesday January 06, 2016 @06:25AM (#10849910)
I cant answer for keithwhor I think websocket support is a huge + for picking nodejs.

Lately rails got their socket support, and python3 has been getting better support through async, but in both those languages, I've long felt its been pretty experimental, and there simply hasnt been a performant option available that has a good opinionated framework.

Nodejs has performance going for it at least if you look at the language benchmarks, and now with ES6, it feels like the language is finally starting to shape up.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by keithwhor on Wednesday January 06, 2016 @06:29AM (#10849921)
Nodal doesn't have built-in socket support right now but the benefits of non-blocking IO in node are obviously huge.

(It will. I just want to make sure I do integrated socket support right. I don't want to chase realtime frameworks because that's not Nodal's value prop, but I do want it to be easy to create socket connections when they're needed.)

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by irregularexp on Wednesday January 06, 2016 @06:33AM (#10849937)
Elixir + Phoenix seems like a better choice if websockets is going to be a core feature, since the BEAM's concurrency model is better and Phoenix's "Channels" abstraction is so solid. I wouldn't think of using Rails for that use case, even with ActionCable in tow, unless it was a minor feature.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by dev360 on Wednesday January 06, 2016 @06:47AM (#10849994)
YES!!! I've been looking very carefully at this, but Elixir still feels intimidating to me. A friend of me gave me an ebook which I'm working through at the moment.

For me, the jury is still out on whether I will be able to model my domain well in a language like Elixir.. I love Haskell, but I sometimes wonder if its a healthy attitude to be so stubbornly against OO. That said, I understand the arguments against essentially `this` and mutability. Any pointers on how to model your domain model in FP would be really welcome!

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by chaostheory on Wednesday January 06, 2016 @06:30AM (#10849926)
> Why use JavaScript on the server at all?

One major advantage I can see is if you're a full stack dev. You don't have a switch languages when you're building the backend and the front end. Some people may not see this as an advantage, but personally it takes some time for my brain to switch to javascript for the front end when I've been using either java, python, or ruby for the backend.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by enkephalin on Wednesday January 06, 2016 @06:36AM (#10849949)
i could imagine that a decent full stack dev would rather use the right tool for the right job. thinking your scenario further, you would use something like couchdb instead of a relational db, because it utilizes javascript.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by chaostheory on Wednesday January 06, 2016 @06:48AM (#10850000)
> i could imagine that a decent full stack dev would rather use the right tool for the right job.

The right tool depends on the requirements. If there's no special requirements then I don't see why javascript can't be a substitute for ruby, python, php, or perl on the backend.

> you would use something like couchdb instead of a relational db

I'm not sure this is a good analogy since javascript (as well as the backend languages that it seeks to substitute for) is more of a general purpose tool, and not a super specialized datastore.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by zodiac on Wednesday January 06, 2016 @06:27AM (#10849913)
> ease/speed of prototyping, pure performance, a good concurrency model

out of curiosity, which language + library/framework pairs do you think is a better tool than javascript + nodejs when evaluated along each of your 3 metrics?

I moved from python + flask to nodejs a while ago, I still thing nodejs is better than python + flask, but I'm trying to move away from javascript on the backend.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by spoiler on Wednesday January 06, 2016 @06:36AM (#10849946)
>> ease/speed of prototyping, pure performance, a good concurrency model > out of curiosity, which language + library/framework pairs do you think is a better tool than javascript + nodejs when evaluated along each of your 3 metrics?

ease/speed of prototyping: Ruby (or Python, even), Go, [Crystal]

pure performance: Go, Rust, C++, C, Scala, [Crystal]

a good concurrency model: Erlang, Go, [Crystal (similar to Go)]

A small note about why Crystal is in brackets: The language is very young compared to the rest, and it's currently very volatile in terms of syntax/API stability, or even compiler semantics, but it looks very promising and it's quite easy to get started with it or to become a contributor because the compiler is written in itself. http://crystal-lang.org/ (Sadly, /docs is a bit outdated and misses some crucial parts, but /api is very comprehensive).

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by moonchrome on Wednesday January 06, 2016 @06:36AM (#10849948)
Clojure - if you're looking for a dynamically typed language with REPL driven development process - it can leverage the huge JVM ecosystem and the concurrency tools are best in class compared to mainstream languages. Performance often comes down to idiomatic vs optimized - but you can optimize stuff and there's always "drop to Java transparently" card if you hit a wall in some area.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by irregularexp on Wednesday January 06, 2016 @06:36AM (#10849944)
I choose Rails for fast prototyping, recently Go if I want pure performance that I can't get from caching, and Elixir + Phoenix if I need a good concurrency model and/or high throughput, but don't necessarily care about the microseconds that can be shaved off with Go.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Scarbutt on Wednesday January 06, 2016 @10:06AM (#10850826)
I think the issue there for most is that you mentioned three different programming languages.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by matthewrudy on Wednesday January 06, 2016 @07:05AM (#10850040)
That's interesting.

I should do some real world benchmarks on Elixir vs Go for my own purposes.

But I'd imagine if you really care about microseconds, you should use a language without GC.

Rust would seem a good choice.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by gldalmaso on Wednesday January 06, 2016 @06:29AM (#10849919)
I believe the main selling point is sharing business code in both client and server, recently known as Isomorphic Javascript Applications.

I think that this is specially appealing for people that are building offline enabled clients, which end up having to handle more business logic than usual for client-side code.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by tomelders on Wednesday January 06, 2016 @06:37AM (#10849950)
A big chunk of UI work is typically input validation which should happen client side and server side. And you'll usually need regex for this at somepoint. Having the same validation logic and regex engine on either side is a huge win.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Keats on Wednesday January 06, 2016 @12:49PM (#10852092)
In practice that depends on the app quite a bit, something like http://marshmallow.readthedocs.org/en/latest/ makes validation a breeze on the backend for an API and you will need the database for more complex ones anyway. Again that probably depends on the app, but the only duplication in mine right now would be the password length which is a 1 character change.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by bryanlarsen on Wednesday January 06, 2016 @08:13AM (#10850288)
Another reason : you can send ops over the wire rather than data. For example, you can send "add 7 to x" when the user makes a change rather than "set x to 21". Then you use the same code on server and client side to execute the ops.

If you structure your ops to be reorderable and composable you can get nice stuff like multi user editing, arbitrary undo, multi data centre synchronization, etc.

See the google docs papers for more details.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by paulpepper on Wednesday January 06, 2016 @08:47AM (#10850430)
Can you offer any references to the google docs papers that you refer to?
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by bryanlarsen on Wednesday January 06, 2016 @08:57AM (#10850468)
Google for "Operational Transformation". That turns up lots of good stuff. The wikipedia article includes links to Google Wave papers, which I think is the papers I'm referring to. It's been several years since I read them, though.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by qaq on Wednesday January 06, 2016 @07:01AM (#10850027)
Well at the very least your are missing isomorphic/universal apps. One case when it's best in class is edge servers backing mobile clients/SPAs that need to have millions of web sockets open. Tooling I can have single package manager for backend and frontend I can use same packages on backend and frontend. I can use single language to develop for Server,Web,Mobile.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by hellbanTHIS on Wednesday January 06, 2016 @06:40AM (#10849965)
developers developers developers!

For example I'm taking some front end javascript I've been working on and putting it on the server (using another new node framework based on Laravel that so far I really like: http://adonisjs.com ) and it would definitely perform better if I rewrote it in Go or Elixir - but even if I could figure out how to do that if the thing takes off I could never find anyone to help me with it.

With JS though it should perform reasonably well (node is supposedly pretty fast where it counts, nonblocking and all that) and I could hire a danged high school kid to give me a hand with it if it somehow succeeds. I imagine a company like Walmart was thinking along those same lines when it chose Node.

Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by dustingetz on Wednesday January 06, 2016 @06:45AM (#10849983)
Client/server data sync and optimizations like server side rendering are easier with code-sharing between client and server. Though as far as I can tell, this framework doesn't leverage code sharing for either purpose.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by wootez on Wednesday January 06, 2016 @06:38AM (#10849955)
Everyone knows how to javascript, that's why it's the best. It's really that simple, put yourself in a position where you have to hire, you'll see why.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by enkephalin on Wednesday January 06, 2016 @06:40AM (#10849966)
that's like letting surgeons operate with kitchen knives, because everybody has experience with those.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by Gigablah on Wednesday January 06, 2016 @11:53AM (#10851583)
If you hire surgeons to cook meals, then by all means let them use kitchen knives.
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by humbleMouse on Wednesday January 06, 2016 @11:05AM (#10851205)
Haha, that's a really good metaphor :)
Re:Show HN: Nodal. Next-Generation Node.js Server and Framework by enkephalin on Wednesday January 06, 2016 @06:31AM (#10849932)
i just started my first node project for the simple reason that i need 70% of the functionality of the application on both the server and the client.