Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Creating a language/runtime for fun, is this idea dumb or not
7 points by hot_gril 6 months ago | hide | past | favorite | 9 comments
I was thinking of writing a language/runtime on top of Golang for fun and self-education. It'd be interpreted and use an event loop, sorta like JS except with opposite defaults: every function is async unless otherwise marked sync. A lot of built-in stuff like math would be sync, and it'd warn you if the event loop is spinning very fast (meaning you should probably paint more stuff as sync).

No strong reason for using Golang other than it's the one sorta popular language I've never used, so I'd get to learn it.

But I don't want to do a project that's pointless even in theory. For applications with lots of blocking I/O, I feel like an event loop can be more efficient than Golang greenthreading. Does anyone want to talk me into or out of this?




Dumb idea? No way. Actually, I'm currently reading Crafting Interpreters which is exactly this. It's free to read online, if you wanted to check it out: https://www.craftinginterpreters.com/

Super fun book.


If you're aiming to create some kind of 'product', then... dunno, your time may be better spent elsewhere.

But if "for fun and self-education", then it is not pointless, right? Go ahead!


Well I have limited time for fun and self-education. But yeah it's not a product.


> every function is async unless otherwise marked sync

Very interesting, I’ve never heard of a language doing that.

I say go for it, it won’t be pointless or dumb and at the very least you’ll learn a tonne about language design!


Why seek the approval of others before embarking upon a journey of educational discovery?

I guarantee you that you will only be capable of fully appreciating the entire general area you are speaking of AFTER attempting some such project in that space.

Wasted effort doesn't exist, nor will you likely take advantage of initial ideas or code.


Because I'm wondering if someone more experienced in greenthreading knows how good of an idea this is, or has other advice.


Fun doesn't need justification. You'll always learn things as the constraints add up and you have to get around them.


It's just more fun if I know I'm making something that isn't a strictly worse version of something that already exists. Also it's more educational if I'm pushing some kind of boundary.


you'll have to think carefully about sharing and communication among your asyncs




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: