Live data from Hacker News

Lang Jam: create a programming language in a weekend

github.com

21–30 of 135 posts

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

#21

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…

Haven’t looked at the rust compiler code base, but often with languages you can hack together subsets via deletions and comments and flags of existing compilers.

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

#24

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…

Maybe some ideas here: https://github.com/thepowersgang/mrustc

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

#26
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]

The usage of `unless` strikes me as unmaintainable and "smart", not in a good way tbh. The types are all other the places, too. What is it even doing exactly? Appending a string to a null value..?

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

#27
post #24

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…

Maybe some ideas here: https://github.com/thepowersgang/mrustc

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

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

#28
post #27
post #24

Earlier quoted context omitted.

Maybe some ideas here: https://github.com/thepowersgang/mrustc

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

Bootstrapping on platforms where llvm isn't supported?

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

#29
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]

I'd like a language that makes it easy to mock and dependency inject without doing anything special.

IE, if in my business logic, I write "new Foo()", I'd like to be able to write a unit test where I say something like, "whenever I wrote 'new Foo()' swap in this mock object instead."

Or, in a module that's an entry-point, I'd like to say, "whenever I wrote 'new Foo()' swap in this subclass instead."

I've spent so much time refactoring to make code mocking and dependency-injectable.

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

#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 the same style?

Post reply on HN