News for hackers. Stuff that matters.
Re:Fast high-level programming languages by zozbot234 on Monday May 18, 2020 @08:39PM (#23230074)
It's so sad that OP bothered to benchmark Nim and Crystal, but no Rust.
Re:Fast high-level programming languages by stolen_biscuit on Monday May 18, 2020 @08:44PM (#23230110)
Is Rust really high level?
Re:Fast high-level programming languages by amalcon on Monday May 18, 2020 @09:11PM (#23230274)
Once upon a time, "high level" unambiguously meant higher than assembly language. A smallish fraction of the population still uses it that way.
Re:Fast high-level programming languages by Measter on Tuesday May 19, 2020 @11:43AM (#23236095)
It can really depend how you write it. In some instances you can just throw things together and it can look a fair bit like you might write it in what many would consider high level languages.

On the other hand, there are times when you really need to get into the nitty gritty of things for performance reasons, and it ends up feeling quite low level.

For example, here's a Rust program which does the same as fqcnt_py1_4l.py: https://gist.github.com/Measter/d31abe88b5e318ba98856bf6f047...

It's longer than the Python version[0], I'm going out of my way to not allocate for every string. But, and maybe I'm biased here, it doesn't really feel like it's low-level code.

[0] https://github.com/lh3/biofast/blob/master/fqcnt/fqcnt_py1_4...

Re:Fast high-level programming languages by eximius on Monday May 18, 2020 @09:31PM (#23230407)
I would qualify a language as high level if you're not expected to deal with pointers in 'normal' use. Yes, Rust has pointers, but using them is NOT normal.

C/C++/C#/D, etc are not high level by this criteria.

There are also of course degrees to all this. Rust is lower level than a lot of languages by virtue of having native pointer uses, even if it's frowned on.

There's also something to be said for language features, but I can't quite put my finger on it.

Re:Fast high-level programming languages by mwindow on Tuesday May 19, 2020 @04:17AM (#23232548)
I disagree. Rust still requires thinking about low-level details like lifetimes, aliasing, whether/when to use `Box` or `Rc` etc., Even when these are not explicitly spelled-out sometimes (like in lifetime elision), the programmer still has to be aware of these. Plus, modern C++ also abstracts away raw pointers by your definition, and has `unique_ptr` and `shared_ptr` which are the same as `Box` and `Rc` respectively. Bare pointers are frowned upon in modern C++ too. Furthermore, the OP talks about languages high-level enough to be used by biologists, while maintaining an acceptable performance.
Re:Fast high-level programming languages by xyhopguy on Tuesday May 19, 2020 @10:38AM (#23235335)
Problems like the benchmark in the post are actually really simple to write in rust. They're all essentially streaming algorithms with some simple parsing.

Fwiw rust has completely replaces cpp for high performant bioinfx code in my workflows. Sooo much easier to write than cpp!

Re:Fast high-level programming languages by catblast on Monday May 18, 2020 @10:25PM (#23230712)
The difference between pointers and references can easily become muddled. If you have a language with pointers that are non-nullable, type- and memory-safe, is that not high-level?

I think a good real-world example that exposes the problem in your definition is Go. Go has pointers, using them is normal. However, go does not pointer arithmetic and outside of unsafe (like Rust) they are memory safe. I consider golang to be higher level than C/C++ for this reason, and many others (GC, channels, defer, etc, etc) -- I'd also consider it lower-level because of its non-answer/cop-out to error-handling.

But what is special about pointers compared to references? If you have a language with pointers that are type-safe and memory-safe how is this distinctive?

Re:Fast high-level programming languages by eximius on Monday May 18, 2020 @10:40PM (#23230811)
I mean, even Python has references to variables. You can't escape references (as opposed to values).

The difference is one of model. Pointers are an exposure of the underlying computer architecture. Whereas references are more of a property of common language design. In theory, you could not have pointers but still have references.

Re:Fast high-level programming languages by catblast on Monday May 18, 2020 @11:22PM (#23231008)
> Pointers are an exposure of the underlying computer architecture. Whereas references are more of a property of common language design.

Sorry, I just don't follow. How are the pointers in Go more exposing of the underlying architecture than a reference? (I'm using Go as an example to make it concrete, but any language with similar properties will do).

The syntax and some of the semantics of assignment and rebinding are different between say go pointers and python references, but that's the point I'm contesting, I don't see how one is necessarily higher level than the other. If you put automatic memory management, null pointer checks, removal of any "undefined behavior", pointers aren't necessarily low-level. It wasn't the pointer, it was the memory safety.

I personally think that once you tease it out that it becomes a semantics argument that unfortunately doesn't shed much light on what is "high-level".

Re:Fast high-level programming languages by nyanpasu64 on Wednesday May 20, 2020 @04:12AM (#23244496)
I feel that defer is lower-level than C++ RAII which happens automatically in destructors without manually specifying. C has compiler-specific defers, and you can emulate defer using C++ RAII (though clunky).
Re:Fast high-level programming languages by AndrewGaspar on Tuesday May 19, 2020 @10:49AM (#23235461)
Dealing with pointers in C# is not normal.
Re:Fast high-level programming languages by pasquinelli on Monday May 18, 2020 @08:57PM (#23230197)
to me a language is low level if variables are memory addresses and flow is controlled with jumps.
Re:Fast high-level programming languages by sfkdjf9j3j on Monday May 18, 2020 @08:58PM (#23230206)
I think you could make that argument, although it might involve using Arc<T> for everything
Re:Fast high-level programming languages by TylerE on Monday May 18, 2020 @08:59PM (#23230213)
I wouldn't. Rust is WAY too much ceremony to qualify as high level.
Re:Fast high-level programming languages by ginko on Tuesday May 19, 2020 @09:48AM (#23234831)
Even C is a high level language.
Re:Fast high-level programming languages by 0xDEEPFAC on Monday May 18, 2020 @08:46PM (#23230117)
I second you and raise you Ada and C++. C is the furthest thing from a high-level programming languages there is...

Comparing scripting languages to compiled languages is apples and oranges. The advantage of scripting is supposed to be the convenience - not speed.

Re:Fast high-level programming languages by VWWHFSfQ on Monday May 18, 2020 @08:52PM (#23230163)
> C is the furthest thing from a high-level programming languages there is

how times have changed

Re:Fast high-level programming languages by pasquinelli on Monday May 18, 2020 @09:01PM (#23230227)
i think there needs to be a new set of terms. ah, that probably wouldn't help, because people would then mismatch eachother's idea of what terms mean and which set of terms correspond to which ideas. still, if people are calling c low level then what should assembly be called?
Re:Fast high-level programming languages by rcoveson on Monday May 18, 2020 @09:25PM (#23230373)
Low-er? High and low are relative adjectives almost everywhere they're used. C is a low level programming language relative to most other programming languages; it has fewer layers of abstraction than say, Java. In a conversation discussing x86 assembly, LLVM IR, and C, then C would be high level. But that's usually not the conversation being had; there are a hundred times as many Java programmers as there are x86 assembly programmers.

We don't need a new set of terms. Relative terms are fine, they're just context sensitive.

Re:Fast high-level programming languages by hexaga on Monday May 18, 2020 @09:16PM (#23230304)
Imo the problem is that 'high' is a relative term. It's calibrated according to whatever the commonly used abstraction level is for the term-speaker.

The other problem is that level doesn't really mean anything, or it means something different in each language. Is it feature count? Abstraction potential? Memory-addressed vs objects? Statically or dynamically typed? Closeness of fit to the machine it's running on (imagine a lisp on a lisp machine, or x86 on an emulator - is that high or low level?)? Etc.

Re:Fast high-level programming languages by pasquinelli on Tuesday May 19, 2020 @02:14AM (#23231765)
If "level" is ill-defined then low and high aren't relative terms, they're meaningless. But there is a lowest either way, the machine code. Then high level programming languages have the programmer writing code in a model independent of machine architecture. Those models are't one dimensional, so let's not bother trying to put them in order from low to high, let's talk about their features.

That's how i'd have it if it were for me to decide, but this isn't how language evolves.

Re:Fast high-level programming languages by mehrdadn on Monday May 18, 2020 @10:16PM (#23230673)
I wouldn't mind categorizing "assembly language" differently from "programming language".
Re:Fast high-level programming languages by pasquinelli on Tuesday May 19, 2020 @01:34AM (#23231555)
Yeah, i think that's fair.
Re:Fast high-level programming languages by stOneskull on Monday May 18, 2020 @10:11PM (#23230652)
assembly is 2nd generation. a higher level than machine code or manual switches.
Re:Fast high-level programming languages by pasquinelli on Tuesday May 19, 2020 @02:15AM (#23231775)
Assembly was an alternate notation for machine code, but i understand nowadays that's a fiction.
Re:Fast high-level programming languages by fortran77 on Monday May 18, 2020 @09:21PM (#23230340)
No there doesn't. People need to respect the terms of the art.
Re:Fast high-level programming languages by SAI_Peregrinus on Monday May 18, 2020 @09:01PM (#23230229)
> C is the furthest thing from a high-level programming languages there is...

C (especially C99 and up) is far, far higher level than something like FORTH.

Re:Fast high-level programming languages by hawski on Tuesday May 19, 2020 @12:20PM (#23236641)
OP had a specific high-levelness in mind, that Rust does not fall into. C is provided as performance baseline, which is a common benchmark. The languages are compared against Python - Nim and Crystal are closer to Python than Rust. For example GC is a requirement at language level implied by the author.

Rust is cool, but it does not have a horse in this race I'm afraid.