Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Except in most of the other languages, it just comes out so FUGLY. I have done metaclass hacking in Python, and you can do it sure, you can make it do some cool stuff even. But ugh, it burns the eyeballs to implement. Manipulating the AST is just so elegant in Scheme compared to anything else I've seen.


I'll give you directly rewriting the source tree as a list, that is pretty cool. But about 70% of the coolness of macros can in principle be done in a C-like. (I'm doing it!) It just comes out a bit ugly cause C-like parse trees are inherently ugly, imo, cause the language imposes a more diverse structure.

Pattern matching would probably help a ton for destructuring - being able to take "$a + $b" and decompose "2 + 3" into "a=2, b=3", but that's kind of difficult. There's ways you could do it cleanly, like imposing a very predictable structure on your AST nodes, but they end up sort of reinventing Lisp through the backdoor. Luckily you don't need that for most macros, afaict.


I spend all my time these days in S7 Scheme and ANSI C to be honest. (I guess technically in C, and in Scheme-in-C!) So I won't argue against the beauty of C when you want to know exactly what the computer is doing... It's gotten to the point where I just don't even want C++ anymore, I'm becoming one of those weirdos, haha. :-)


Oh no count me 100% in the anti-C++ camp, it's a horrid language. I'm happy enough using D for the dayjob, but I'm writing a replacement on the side.

Weirdly, lots of D people end up doing that. I blame the fact that it's a language that's both obviously better than the languages it's competing with, and also obviously worse than it could be.


I'm also writing my own Scheme-like language in Zig, which will be used mainly for scripting in my game engine. The simplicity of Zig + Lisp is godsent. (all experimental, just a hobby, no production purpose)


Yeah, Lisp is definitely great if you just want to get an interpreter up with minimum fuss.


Is a language that's both obviously better than the languages it's competing with, and also obviously worse than it could be the definition of an adoptable language?




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

Search: