occs-compilers-2014-spring / discussion

A place for discussion
0 stars 0 forks source link

What language(s) are people using? #3

Open ikehz opened 10 years ago

ikehz commented 10 years ago

Out of curiosity, and perhaps for the sake of collaboration, what language(s) are you using?

ikehz commented 10 years ago

Ruby 2.1.0.

peter-fogg commented 10 years ago

Haskell. If anyone else is using a functional approach I'd be interested in talking about your implementation. Bob's code is all imperative and it takes some thought to translate it to pure functions.

dan-f commented 10 years ago

Python 2.whatever

dan-f commented 10 years ago

Although I might use Python3.

oshoham commented 10 years ago

Python 2.7.6

dbarella commented 10 years ago

Python 3, and it's kinda annoying to run into differences in function parameters between the minor versions of 3 because they will crash the program. My computer has a newer python 3 than OCCS, and I worry that my code will crash on Bob's computer because he's got an 'older' python 3. I already have main() require python 3 but I could require more than that – do you guys think it's evil to do this?

if sys.version_info[0] < 3 or sys.version_info[1] < 3:
    print('This script requires python 3')
    sys.exit(1)

I'd feel pretty dirty about requiring 3.3, but 3.2 has a different str.splitlines spec from 3.3... aka splitlines(keepends=True) vs splitlines(True). Can't mix'n'match that one.

Actually the real question is, is this dirtier:

#In comment preprocessing
if sys.version_info[0] < 3 or sys.version_info[1] < 3:
    src = raw_src.splitlines(True)
else:
    src = raw_src.splitlines(keepends=True)
dan-f commented 10 years ago

Yeah I ran into some weirdness with Python 3.3 vs 3.2 on the lab machines. I just ended up using 2.7.6 locally, with 2.6 on the lab computers, since it seems that they're much more compatible than 3.3/3.2.

nteetor commented 10 years ago

C (a little late, but I haven't switched yet)

dbarella commented 10 years ago

@nteetor C, really? Later on we should make some test files and post compilation times. I wonder how the interpreted-language-based compilers will fare against C.

dan-f commented 10 years ago

I'm also curious to see if there will be a significant discrepancy in running time between implementations in compiled and interpreted languages. Theoretically I'd like to think the difference wouldn't be too great, since our algorithms so far haven't been especially computationally expensive.