ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
401 stars 40 forks source link

Added class templates to the language. #965

Closed alexnask closed 8 years ago

alexnask commented 8 years ago

They can be extended from, either partially (e.g. Bar: class template <T> extends Foo<Int, T>) or fully (e.g. IntWrapper: class extends Foo <Int>).

In addition to adding type templates, this PR closes #964.

See fasterthanlime/nagaqueen#29 for the (one line) grammar changes.

alexnask commented 8 years ago

Oops.
Those failing tests passed at some point earlier in the commits.
That will teach me to not test the final version on my local machine.

Anyway, I'll be on it

alexnask commented 8 years ago

Actually, they pass on my machine >_>
Well, that is weird af.

alexnask commented 8 years ago

Seriously, those tests run fine on my machine...
Well, I'm giving up for today before I fry my brain.

vendethiel commented 8 years ago

Cool stuff :D good job

alexnask commented 8 years ago

Thank you :)

Hopefully I will find out what is causing Travis to choke on those two tests swiftly tomorrow and have it merged.

refi64 commented 8 years ago

What version of rock is Travis using for bootstrap? That might be an issue...

alexnask commented 8 years ago

Travis is just using the latest make rescue build.
Anyways, it manages to build itself with c_rock, then build rock with rock, so if it gets up to the tests, it means the resulting rock is good.

fasterthanlime commented 8 years ago

pretty sure travis is using quick-rescue? careful

alexnask commented 8 years ago

Travis does:

  - make -s rescue
  - make clean self
  - make clean self

So it makes c_rock, c_rock makes rock (make -s rescue), rock makes rock (make clean self), rock makes rock (makes clean self).
I don't think it could be a bootstrapping issue anyway since it is failing on tests that used to pass.

Anyway, I'm on it right now

alexnask commented 8 years ago

I can now reproduce the two errors on a fresh install on my linux distro, so I'm ready to go to town :)

alexnask commented 8 years ago

I'm merging this but I'm sure there will be tonnes of bugs related to templates to fix, so please report as many as you can if you play with them :)

Things to note at the moment:

My focus will now be on #895 which bugged me quite a bit while making this (and there are a couple of workarounds here).