Live data from Hacker News

A Programming Language Underdog

totallywearingpants.com

161–170 of 238 posts

Re: A Programming Language Underdog

#161
post #158

Earlier quoted context omitted.

Multiple large programs written in LuaJIT that have better performance than the same programs written in optimized C. The vast majority of benchmarks I've seen are down to LuaJIT performing specific optimizations out of the box that the C compiler used in the comparison can perform but doesn't. In particular the last time I looked at LuaJIT vs C++ benchmarks, the C++ compiler flags weren't set allow the use of SIMD i…

Java is just as fast or faster than C++ most of the time. No one who writes high performance code for a living makes that claim. It's true though. https://lmax-exchange.github.io/disruptor/files/Disruptor-1....

Java is fast enough that the increased programmer productivity of the GC and other features wins out in many cases. People aren't choosing Java over C++ because it results in generally more performant code.

How many AAA game engines are written in Java?

Re: A Programming Language Underdog

#162

There is a race going on for the first language not being javascript being compiled to javascript/webassembly and actually worth using. No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Several options are in the works. Implementations of Python and .Net (Blazor). Languages like Rust or Nim. The crucial point is that it needs to have a compelling framework like vuejs or r…

> No, coffee-script, typescript and the like don't really count, they are relatively thin layers.

Why is being thin a disadvantage?

Re: A Programming Language Underdog

#163

There is a race going on for the first language not being javascript being compiled to javascript/webassembly and actually worth using. No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Several options are in the works. Implementations of Python and .Net (Blazor). Languages like Rust or Nim. The crucial point is that it needs to have a compelling framework like vuejs or r…

In my opinion, that race has been won.

Ocaml, or it's cousin ReasonMl are well worth looking into. Compile to JS with Bucklescript. Compelling frameworks are Bucklescript-Tea for an Elm like experience or Reason-React as a layer over React. Both frameworks are excellent.

Re: A Programming Language Underdog

#164

Earlier quoted context omitted.

See, this is what I thought too. Turns out, by compiling to C or C++, you can use their toolchains. Debuggers, codecov, emscripten...

"Can use" is different from "can use productively." Technically if it's compiled to C/C++ you can use gdb/lldb etc, BUT the compiled version may be so drastically different from the input that it's effectively useless to track down logic errors in the original.

C has this nice preprocessor directive that indicate the actual source code:

   #line 42 "actual_source.lang"
Subsequent tools like gdb/lldb pick up on that, and point to your source code instead of the intermediate C. So you don't care that the C code is wildly different from your own, the tools can still point to to the right place.

Sounds pretty productive to me.

Re: A Programming Language Underdog

#165

Nim is my favorite language right now. If you look at the different metrics that we use when discussing programming languages, it might not be the best of any category, but its "good enough" in every category. It might not have as powerful a type system as Haskell, but it's safe enough. It might not be as fast as C, but its fast enough. It might not be as easy as Python or Ruby, but it's pretty easy to get started wi…

What does it use for desktop UI dev?

Re: A Programming Language Underdog

#166

There is a race going on for the first language not being javascript being compiled to javascript/webassembly and actually worth using. No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Several options are in the works. Implementations of Python and .Net (Blazor). Languages like Rust or Nim. The crucial point is that it needs to have a compelling framework like vuejs or r…

> No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Why is being thin a disadvantage?

Both coffeescript and typescript have a respectable following, and for good reason. But their data model is completely tied to javascript, and thus limited. Also they are pretty much stuck with javascripts performance.

Basically, Webassembly was created for performance reasons. But you don't need Webassembly just to compile Javascript, Typescript and Coffee-script, and you can't use its benefits through these languages.

On the other hand the performance of Webassembly, both in terms of size and speed, and they enable the use of other data models, like C, Python, Java, .Net or Rust. Webassembly gives us the chance to quit the memory management paradigms of javascript for other options, like manual management, ownership or various garbage collectors.

But those advantages may not be good enough to justify leaving things like react or vuejs (or similar) behind, or glueing the new paradigms to those frameworks. Rust for example has a React-like framework for use in Webassembly.

Re: A Programming Language Underdog

#167
post #66

I do not think all this language fragmentation is a good thing. A million little obscure languages that all at the end of the day do the same thing. Yeah, we need language research to keep devising new features and more efficient ways of programming, but this is different. I wish the world would get behind a couple well thought out languages that cover most programming needs (functional, systems/bare metal, scripting…

After twenty years of professional Python (mostly) development I have suddenly and recently become a neophyte Prolog programmer. Bottom line: If you're not using Prolog you are almost certainly wasting your time. Almost all PLs you're likely to be acquainted with can be thought of as syntactic sugar over Lambda Abstraction. Prolog, from this POV, is syntactic sugar over Predicate Logic. It's actually a fantastically…

Lovely paean to Prolog. Now do APL. :-)

Re: A Programming Language Underdog

#168

Since I have used Nim in a small team effort creating an enterprise data analysis application, let me put in a good word. The ease of coding and speed of execution was what caught our attention. I was expecting the worst (from past experiences with new languages) but we were so surprised that we could complete our project all in Nim. These are a few things that I love with Nim: - One's knowledge of Python jives reall…

What about run-time safety? e.g. are the pointers? does it have builtin in array bounds checking? (Heck, does it even have arrays?)

Re: A Programming Language Underdog

#169

Earlier quoted context omitted.

I know this has been said before but for me it's as simple as: "Format your code as you would have done anyway but just leave out the curly braces". It reduces rather than increases the number of things I have to think about.

My problem with this is that you have to make sure every contributor has the same editor settings. You have to also configure every editor before you can use it to write code in such a language, which is sometimes impractical. Curly braces make this not an issue an they're visible. I don't want to depend on non-visible characters for behavior , but it's only a personal preference.

> you have to make sure every contributor has the same editor settings

You have to do that in any language. Ever worked on a C/C++ files where the indentation is different from your settings? I see only 2 choices: either you temporarily adapt your settings, or you just cringe your way through.

The third alternative (use your own settings anyway), is just lazy and mean.

> I don't want to depend on non-visible characters […]

There's an easy solution. First, either forbid or mandate tabs for indentation. Second, forbid trailing whitespace. That way all spaces will be visible.

Re: A Programming Language Underdog

#170
post #163

There is a race going on for the first language not being javascript being compiled to javascript/webassembly and actually worth using. No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Several options are in the works. Implementations of Python and .Net (Blazor). Languages like Rust or Nim. The crucial point is that it needs to have a compelling framework like vuejs or r…

In my opinion, that race has been won. Ocaml, or it's cousin ReasonMl are well worth looking into. Compile to JS with Bucklescript. Compelling frameworks are Bucklescript-Tea for an Elm like experience or Reason-React as a layer over React. Both frameworks are excellent.

Bucklescript doesn't really count, because it is a relatively thin layer on top of javascript, not even Webassembly. It looks interesting, but the lack of popularity argues somewhat against it.

It may be still in the race...

Post reply on HN