Live data from Hacker News

Lang Jam: create a programming language in a weekend

github.com

71–80 of 135 posts

Re: Lang Jam: create a programming language in a weekend

#71
post #59

Earlier quoted context omitted.

OCaml is often dropped due to its unpredictable performance

I've heard the opposite about it, that its predictable performance is one of its strength. Do you have any sources?

Darklang is being rewritten in .Net

Flowtype has horrible performance, which in my opinion partially explains why it has lost so many users to Typescript, which has much more predicable and fast performance even though it's written in JS. The project is basically dead

Re: Lang Jam: create a programming language in a weekend

#72
post #60

Earlier quoted context omitted.

OCaml is often dropped due to its unpredictable performance

Interesting. I’ve actually seen OCaml being chosen because of its predictable performance. But that was by people coming from Haskell.

Well, almost everything has more predicable performance than Haskell. And I love Haskell.

Re: Lang Jam: create a programming language in a weekend

#73
post #50

Earlier quoted context omitted.

You could try OCaml (it does have exception but they're usually "opt in"), it's a really nice language and probably one of the closest to GC'd Rust. There's also Swift that inspired some features.

OCaml is often dropped due to its unpredictable performance

Huh? OCaml is pretty obvious in its semantics and compilation strategy. Maybe flambda changed something, but before that I'd used the compiler source code as a reference on how one would compile an ML.

Re: Lang Jam: create a programming language in a weekend

#74
post #44
post #27

Earlier quoted context omitted.

Why would someone write a bootstrapping rust compiler in C++ when you can just compile the rust to C using a proper llvm backend?

LLVM doesn't support everything. If you want to see what is not supported, the story about Python cryptography migrating from C to Rust is a good start https://lwn.net/Articles/845535/ .

[deleted]

Re: Lang Jam: create a programming language in a weekend

#75
post #31

Earlier quoted context omitted.

I don't see why you would want to do that as you can always ssh into a system where llvm is supported, then compile to C, copy the C sources back to your system and compile rustc using a C compiler.

How are you compiling to C? With the LLVM IR to C backend that was (is?) maintained by the Julia folks? My experience from a couple years ago was that it didn't produce output which would compile with baroque C toolchains for platforms that LLVM doesn't support... I'm giving very unsubtle side eye to you TriCore.

Well, in any case, writing a backend for rust or llvm that generates C is probably still less work than writing an entire rust compiler. Maintaining it is even orders of magnitude less work than maintaining a C++ "shadow" version of the rust compiler.

Re: Lang Jam: create a programming language in a weekend

#76
post #59

Earlier quoted context omitted.

I've heard the opposite about it, that its predictable performance is one of its strength. Do you have any sources?

Darklang is being rewritten in .Net Flowtype has horrible performance, which in my opinion partially explains why it has lost so many users to Typescript, which has much more predicable and fast performance even though it's written in JS. The project is basically dead

None of this seems related to OCaml performance?

Darklang is being rewritten to .Net because they were unsatisfied with the OCaml ecosystem.

Horrible performance is generally more a question of algorithms and software architecture than a problem with a language, which only account for a flat percentage of performance.

Re: Lang Jam: create a programming language in a weekend

#77
post #39

As someone that writes a lot in Rust, I have a longstanding dream to make a compiler for a subset of the language, since I don’t use all features of Rust and my hope is that this way I could have fast debug builds (in terms of compilation time) while I develop, with simplified borrow checker and so on. So then I can iterate faster. That’s one of my dreams. But I have not had time to even look at it yet, as the other…

I think you would be better served by a simplified, less optimized code generation, as from what I understand LLVM is the thing that takes a lot of time. You can see this pattern in Crystal and Swift for example, that also use LLVM and are also relatively slow to compile, compared to OCaml or Go which have their own backend.

Or Haskell, which also has multiple backends to choose from.

Re: Lang Jam: create a programming language in a weekend

#78

As someone that writes a lot in Rust, I have a longstanding dream to make a compiler for a subset of the language, since I don’t use all features of Rust and my hope is that this way I could have fast debug builds (in terms of compilation time) while I develop, with simplified borrow checker and so on. So then I can iterate faster. That’s one of my dreams. But I have not had time to even look at it yet, as the other…

Any ideas on how one can simplify the borrow checker?

Use a garbage collected language instead.

Eventually as optimization point, for the few use cases where the ultimate performance is needed, provide a subset of borrow checker capabilities.

Examples of current efforts into this direction, D, Swift, Haskell, Chapel, some .NET ongoing research.

Re: Lang Jam: create a programming language in a weekend

#79
post #70
post #14

I've been working on a toolkit for creating interpreted languages, right now I'm liking Swift a lot as host language: https://github.com/codr7/swifties

I love working with Swift, but it's such a pain to maintain and deploy it

Depends on the purpose, for those that only care about Apple platforms it is alright.

Re: Lang Jam: create a programming language in a weekend

#80
post #30
post #23

What kind of language ideas do you folks have? What would your fizzbuzz look like? I'm not sure I've ever seen a more readable compact fizzbuzz than this version in coffeescript ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]

Another "crazy" idea: I'd like the compiler to reformat code to match strict style conventions. Why? Sometimes there's no "right" style. Sometimes novices need training wheels. In the long run, style doesn't matter, but in big projects code is easier to read when style is consistent. It's also easier to onboard when code follows industry-standard styles. Would it be better when a language gently pushes everyone to th…

I have that at work with javascript/typescript and eslint.
Post reply on HN