Live data from Hacker News

What you learn by making a new programming language

ntietz.com

61–70 of 137 posts

Re: What you learn by making a new programming language

#61

This is so true. I feel like I've learned more about programming in the last two years making Cassette[1] than in the past decade of professional software development. Every developer should make a language at some point. I want to see everyone's weird, half-baked languages! I want to hear about what other people struggled with, and the tradeoffs they've made! [1]: https://cassette-lang.com

This looks neat. I tried VB.NET a few weeks ago, and felt like it was mostly pointless since almost all resources are done in C# and so you have to translate from C# to VB.NET anytime you want to do anything, which can be a bit of a pain.

But one thing I really liked was the "begin end" type of code blocks.

Re: What you learn by making a new programming language

#62
post #13

I've had two projects that end up being "oops, I made an interpreter". It starts innocently enough, you just have a JSON that has some basic functionality. Then you decide it would be cool to nest functionality because there's no reason not to, so you build a recursive parser. Then you think it'd be neat to be able to add some arguments to the recursive stuff, because then you can more easily parameterize the JSON. T…

See also the Configuration Complexity Clock: https://mikehadlow.blogspot.com/2012/05/configuration-comple... . This is why I have a separate config language and code language. My config language is essentially JSON with newline separators and a first-class binary type (base64). I added little else. When I get the temptation to add code to it, I just pull out my other, general-purpose language instead.

Personally I've seen 9pm be a holy grail, an exceedingly advantageous position to be in. But, it's exceedingly challenging to figure out what that DSL should and should not have as well.

Re: What you learn by making a new programming language

#63

Earlier quoted context omitted.

See also the Configuration Complexity Clock: https://mikehadlow.blogspot.com/2012/05/configuration-comple... . This is why I have a separate config language and code language. My config language is essentially JSON with newline separators and a first-class binary type (base64). I added little else. When I get the temptation to add code to it, I just pull out my other, general-purpose language instead.

I'm basically in charge of maintaining and developing a product that (on purpose) started at 9 o'clock. We've resisted the call to implement loops and such in our DSL but I can hear the wolves howling and I doubt I have much longer...

I think the world needs programmable config langs because slinging YAML and JSON quickly becomes miserable (as is extending them through templating alone) and general-purpose programming languages usually have shitty ergonomics for writing configuration.

The only question in my mind is whether our common config langs should be Turing-complete (e.g., Nix, Nickel, Jsonnet, Pkl) or not (e.g., HCL, CUE, Starlark, Dhall), which I think can only be determined through experience over the long term.

Re: What you learn by making a new programming language

#64
> It's special that we make our own tools

I've always taken this to heart, but not necessarily with programming languages. Any piece of software that helps run my business that I can reasonably make and maintain myself, I do. I build my own CI/CD app, orchestration/deployment tool, task planner, bug tracker, release note editing & publishing tools, blog editor, logstash/viewer for exceptions, etc.

Does building (and especially maintaining!) all of these tools take up a lot of time, and distract me from the primary business of building the software that I actually sell? Sure, of course it does. But it also keeps me fresh and forces me to expand the scope of ideas that I regularly work with, and keeps me from becoming "that guy who makes that one app" and who isn't capable of moving outside of his comfort zone.

And while that doesn't (yet) extend to building my own tools in my own languages, it certainly does extend to writing my own DSLs for things like configuration management or infrastructure. My tools may be homerolled and second-rate, but they're mine (dammit!) and -- this part is important -- no one can take them away from me or catch me out with a licensing rug-pull.

Re: What you learn by making a new programming language

#66

Earlier quoted context omitted.

It's not its own kernel, but emacs can run on Linux as PID 1, at which point it rather seems like it should count as an OS. Given its affiliation, emacs/Linux probably still counts as GNU/Linux, but still...

I say if it's not running as the kernel, it's not an OS. Otherwise you could "boot to" any terminal app. Nano? OS. Cat? OS. Echo? Believe it or not, OS. Good grief.

[deleted]

Re: What you learn by making a new programming language

#67

Earlier quoted context omitted.

It's not its own kernel, but emacs can run on Linux as PID 1, at which point it rather seems like it should count as an OS. Given its affiliation, emacs/Linux probably still counts as GNU/Linux, but still...

I say if it's not running as the kernel, it's not an OS. Otherwise you could "boot to" any terminal app. Nano? OS. Cat? OS. Echo? Believe it or not, OS. Good grief.

What we do know is that the S in OS stands for system. A kernel alone does not a system make. There needs to be other components to round out an entire system. Why does Emacs not fit the bill?

Re: What you learn by making a new programming language

#68
post #5

Earlier quoted context omitted.

Angry upvote. Maybe it's true failing though was stopping short of becoming the OS.

It's not its own kernel, but emacs can run on Linux as PID 1, at which point it rather seems like it should count as an OS. Given its affiliation, emacs/Linux probably still counts as GNU/Linux, but still...

[deleted]

Re: What you learn by making a new programming language

#69
Long time ago I was stuck at the airport and I end up writing a interpreter in Python. I stop the project at arithmetic, so, basically a fancy calculator. After that I saw a really interesting video about Shunting Yard algorithm, so I gave that a got as well [1]. At some point, I want to try to write a programming language, I know a little bit about assembly but it is most theory; haven't done much programming using it (only basic stuff, back in college) but I find it fascinating.

1 - https://github.com/victorqribeiro/shuntingYard

Re: What you learn by making a new programming language

#70
> It will be a bad language, and that's okay

This same advice could be applied to most hobbies. It doesn't have to be good, and it certainly doesn't have to make money. It just has to be fun and rewarding. If you learn something, even better.

> Go Forth, make something fun

*golfclap*

Post reply on HN