Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename .titan extension and directory titan-compiler #36

Merged
merged 10 commits into from
Oct 5, 2018
Merged

Rename .titan extension and directory titan-compiler #36

merged 10 commits into from
Oct 5, 2018

Conversation

pjpollina
Copy link
Contributor

@pjpollina pjpollina commented Oct 5, 2018

As per the 3rd and 4th objective of Issue #22

@pjpollina pjpollina closed this Oct 5, 2018
@pjpollina pjpollina deleted the rename-titan branch October 5, 2018 14:24
@pjpollina pjpollina restored the rename-titan branch October 5, 2018 14:25
@pjpollina pjpollina reopened this Oct 5, 2018
@hugomg
Copy link
Member

hugomg commented Oct 5, 2018

Thanks for showing interest in helping us with this issue.

Please let us know if you need assistance in getting the test suite to run on your machine. It has a shorter feedback loop than Travis :)

@pjpollina
Copy link
Contributor Author

That'd be great, yeah. I really wanna know why this keeps failing.

@pjpollina pjpollina closed this Oct 5, 2018
@pjpollina pjpollina reopened this Oct 5, 2018
@pjpollina pjpollina changed the title Rename .titan extension and directory titan-compiler Rename directory titan-compiler Oct 5, 2018
@hugomg
Copy link
Member

hugomg commented Oct 5, 2018

  1. First of all, you need to make sure that you have the Luarocks package manager installed on your machine.

  2. To be able to run the pallene compiler you need to install its dependencies:

luarocks install --local --only-deps pallene-dev-1.rockspec
  1. You also need to be able to build the runtime library and our modified version of Lua 5.4. Currently our makefile only works on Linux and Mac. If on Linux, make sure that you have the dev headers for the readline library installed (sudo apt install readline-dev, or equivalent for your distro)
make linux-readline  # for linux
make macosx          # for macos
  1. Assuming I wrote everything correctly here, you should now be able to run Pallene. (Do all of these from the root project directory, as per bug Allow the compiler to be called from any directory #16).
# running the compiler
./pallenec foo.pallene
./lua/src/lua -l foo
  1. To run the test suite you need to install Busted. You should be able to do so with Luarocks:
luarocks install --local busted
  1. Run busted to run the full test suite (or just one of the tests)
busted                       # run all tests
busted spec/parser_spec.lua  # run just one of the test files

Please let me know if this works for you or not. If it does, I'll fix our README file to use these instructions.

BTW, you don't need to close and reopen this PR all the time. Travis already informs us when the PR is broken and needs to be fixed so you don't need to do that yourself.

@pjpollina
Copy link
Contributor Author

Thanks! I got this pull working but I'll definitely use that for my future contributions :D

@hugomg
Copy link
Member

hugomg commented Oct 5, 2018

I ran this PR locally and noticed that there are some problems that were not caught by the test suite. Could you please try fixing them?

  1. In our test cases in the spec directory there are many cases where we create a "test.titan" file as input. It should be "test.pallene" now.
  2. The compiler still assumes that the file extension must be ".titan" and produces an error otherwise. We should make the appropriate changes to pallenec and driver.lua to reflect this.
  3. The "titanc_spec.lua" file should be renamed to "pallenec_spec.lua"
  4. The "run_benchmarks" script also assumes that the file extension is "titan". It needs to be updated to the new file extension.

@pjpollina
Copy link
Contributor Author

Sure thing!

@pjpollina pjpollina changed the title Rename directory titan-compiler Rename .titan extension and directory titan-compiler Oct 5, 2018
Copy link
Member

@hugomg hugomg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the help! I think we need just a pair of small changes before merging this PR:

  1. Fix the comments on driver.lua, as per previous comment
  2. Replace "titan" with "pallene" in the .editorconfig file.

-- compile("titan", "so", "foo.titan") --> outputs "foo.so"
-- compile("titan", "c", "foo.titan") --> outputs "foo.c"
-- compile("titan", "so", "foo.pallene") --> outputs "foo.so"
-- compile("titan", "c", "foo.pallene") --> outputs "foo.c"
Copy link
Member

@hugomg hugomg Oct 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to become compile("pallene", "so", "foo.pallene") and compile("pallene", "c", "foo.pallene")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will do.

@pjpollina
Copy link
Contributor Author

Think I got them all.

@hugomg hugomg merged commit 05e1a91 into pallene-lang:master Oct 5, 2018
@hugomg
Copy link
Member

hugomg commented Oct 5, 2018

Thanks!

By the way, have you tried running the test suite on your side? I'm rewriting the README right now so I'd love if you could confirm if the instructions worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants