tj / luna

luna programming language - a small, elegant VM implemented in C
2.45k stars 147 forks source link

decide on typing #18

Closed tj closed 11 years ago

tj commented 11 years ago

really prefer lowercase c-style vec_t, user_t etc, but it can be a bit ambiguous without _t, also core types would be very common so shorter rust-style may be nice:

def greet(name:String) {
  ret "hello " + name
}

vs

def greet(name:string) {
  ret "hello " + name
}

vs

def greet(name:str) {
  ret "hello " + name
}

u8, i8, u16 etc from rust are sexy too

yields commented 11 years ago

+1 for shorter all lowercased types.

str etc..

juliangruber commented 11 years ago

String looks kind of dull with def and ret around

tj commented 11 years ago

haha yeah, the main thing for me is after writing C for a while again you're like wow, lowercase everything looks so much nicer, especially compared to something like Go where it's the complete reverse, all caps

yields commented 11 years ago

this thing drove me away from Go.

req.Send()

it's such a good language, but i couldn't capitalize anymore.

tj commented 11 years ago

same here I like a lot of aspects of but the fact that you have to capitalize to export things etc, nooo thanks, the stdlib seems half-baked as well, I would rather have "first-class" "supported" modules that act as a stdlib but are not baked in, and some things I've been wanting forever like nice function composition:

cat('foo.txt') | grep('tobi') | stdout

is sugar for

stdout(grep(cat('foo.txt'), 'tobi'))

with generators it can flow just like node streams without all the retardation of internals / implementations

one thing i dont like about str etc is that I always use identifiers like that haha, str:string looks a little lame though anyway

tj commented 11 years ago

leaning towards string now, not like we'll have flo for float or anything like that