Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Every once in a while, I come to HN, and inevitably find a post about some new JavaScript technology on the front page, wherein I find some comment that gives me a new appreciation for the web app language I use at work, which fortunately is not JavaScript.


I'd be interested to know what language it is.


It must be one of: Elm, Purescript, GHSJS, Faye or Haste


What is the web app language you use at work? I assume you're talking about something that runs on the client -- a web browser -- so it probably compiles down to JavaScript, right? JS literally has no numeric type that isn't a float, so how does your language escape this fundamental limitation?


Not OP, but I used Google's Long.js (among other things) in a project[0] to get around the limitation of not being able to do as in Python:

    import fractions
    print str(fractions.Fraction.from_float(0.3333).limit_denominator(10))
Almost anything that compiles to JS would be better than by-hand JS; I'd love to use ClojureScript with re-frame at work...

[0] http://www.thejach.com/pseudo-public/webgl_coursera/assignme...


asm.js is proof that a compile-to-JS language doesn't necessarily have to discard the correctness of its number types. A statically typed language can do a lot. Integer values can be can to int32 via `| 0`, longs can be emulated with two numbers (GWT does this).

The tradeoff is speed, especially for dynamically typed languages. Having to check your operand types in JS before doing work is a performance killer.


And WebAssembly means that soon it will be practical to use any language on the client or server side.


It already is on the server-side. Feel free to use C; at least it would be performant.


It's easy to write code that does the wrong thing quickly in any language, and IME that tends to be the usual result of choosing C.


ok, you are aware that the vast majority of the worlds software is written in C.... yes there are problems with it but it is still suitable for real-time, embedded, safety critical software of the sort I've been making quite successfully for close to 30 years.

Don't fall into the 'C is the devil' trap, any tool can be misused.


Straight-up C is not at all suitable for safety-critical software. C plus various bolt-on tools for static analysis and the like can be usable, but is always going to be less effective (IMO) than a unified language where every tool is working according to the same rules.

There might be a few legitimate use cases for C, but I've seen people pick it for the wrong reason so often (and using C because "it would be performant" is entirely invalid IME).


You would have to argue with the overwhelming majority of safety-critical software that is and has been for decades, written in C...

Of course, static analysis is always used in combination with proper coding style... but that is just the normal (professional) C development environment.


> You would have to argue with the overwhelming majority of safety-critical software that is and has been for decades, written in C...

> Of course, static analysis is always used in combination with proper coding style... but that is just the normal (professional) C development environment.

>> Straight-up C is not at all suitable for safety-critical software. C plus various bolt-on tools for static analysis and the like can be usable, but is always going to be less effective (IMO) than a unified language where every tool is working according to the same rules.

Pretty sure you've just restated GP's point in your second paragraph.


You just have to use the right libraries:

https://github.com/Adaptv/ribs2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: