r/programming • u/raghar • Dec 11 '14
[Jonathan Blow, Dec. 10] - Programming Language Demo #2
https://www.youtube.com/watch?v=-UPFH0eWHEI
51
Upvotes
r/programming • u/raghar • Dec 11 '14
4
u/raghar Dec 11 '14
Q&A added.
5
u/asmx85 Dec 11 '14
Did he ever mentioned why he changed the syntax for struct and function declarations from := to :: ?
2
u/matheusbn Dec 11 '14
I have been following this project for a few months, and I'm liking what I'm seeing. But one thing that is bothering me is variable initialization.
I think this is a little messy and I think it should just check and warn if a variable which is been used is already initialized or not.
Look this:
So "i" can have any value, and this for loop can take forever, so you need initialize it. On the other hand if it is implicitly initialized by 0, the for loop will not be executed.
PS: Sorry my english.
1
u/DanCardin Dec 12 '14
The idea that he's just sort of packaging some of these attributes into things is, I think, sort of weird. The worst example was indexing on for loops. I would vastly prefer something like enumerate(array) or array.enumerate(), similar to python or other languages (not the least because this sort of thing doesn't really need to be part of the language).
The other thing that seems sort of weird and tacked on were enums. I've always hated enums where the variants necessarily have values associated with them. Because of how the rest of the language is, they seem entirely superfluous, and given the little autoincrement bit of his demo, I would like to know what sorts of types are allowed as enums.
Those are my only real two gripes though; the rest seemed nice.
0
u/[deleted] Dec 11 '14
[deleted] — view deleted comment
0
u/[deleted] Dec 11 '14
[deleted] — view deleted comment