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

Doesn't seem to work when using nvm #2

Closed
nathggns opened this issue Jul 26, 2015 · 5 comments
Closed

Doesn't seem to work when using nvm #2

nathggns opened this issue Jul 26, 2015 · 5 comments

Comments

@nathggns
Copy link

Hi. I'm using nvm to manage my node versions but when I install impl I cannot run it.

Nathaniels-MBP:~ Nathaniel$ nvm --version
0.25.2
Nathaniels-MBP:~ Nathaniel$ node --version
v0.12.3
Nathaniels-MBP:~ Nathaniel$ npm --version
2.9.1
Nathaniels-MBP:~ Nathaniel$ npm install -g impl
impl@1.3.0 /Users/Nathaniel/.nvm/versions/node/v0.12.3/lib/node_modules/impl
Nathaniels-MBP:~ Nathaniel$ impl
-bash: impl: command not found

I cd'd into my impl folder inside my nvm node_modules folder and this is the folder structure I have.

Nathaniels-MBP:impl Nathaniel$ pwd
/Users/Nathaniel/.nvm/versions/node/v0.12.3/lib/node_modules/impl
Nathaniels-MBP:impl Nathaniel$ find .
.
./.DS_Store
./CHANGES.md
./lib
./lib/impl.js
./LICENSE
./package.json
./README.md

Let me know if I can help you any other way.

@Olical
Copy link
Owner

Olical commented Jul 26, 2015

Hah, thanks for having a look. It's still only the reader right now, so the README is lying to you, sorry. You can read source into a data structure, but I still need to perform code generation and macro expansion upon that code. Maybe before code gen...

impl isn't even on NPM yet I'm afraid. It will be released as 1.0.0 on there once it can execute even if the "standard library" is pretty empty. The bin that is executed and aliased to impl doesn't do anything yet, but it will pipe the given source through the reader (which is done) then fire that through eval before spitting out JavaScript.

I should have the first full working version in a few weeks. It'd be cool to get a repl working too, shouldn't be hard once I have eval working.

@Olical
Copy link
Owner

Olical commented Jul 26, 2015

TL;DR: It will work with NVM... when it exists... :D

@Olical Olical closed this as completed Jul 26, 2015
@Olical
Copy link
Owner

Olical commented Jul 26, 2015

Feel free to check out how the reader works though and critique it. I quite like that it parses the entire source code in one run through the string, but maybe you'll have some thoughts on it.

@nathggns
Copy link
Author

Oh sorry, I saw your fib example on Twitter and was a bit confused as to how it worked so I thought I'd try to use it and convert it to JavaScript and then see how it works from there.

@Olical
Copy link
Owner

Olical commented Jul 26, 2015

Ah, I apologise for the confusion, I'm just glad I got it to parse / read the source. Equivalent JavaScript would be the following, although I hope to get around the tail recursion problem in Impl:

function fib(n) {
  if (n < 2) {
    return 1
  } else {
    return fib(n - 2) + fib(n - 1)
  }
}

(this would blow the stack quite quickly due to the recursion, so I hope to add tail recursion somehow which optimises the problem out)

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

No branches or pull requests

2 participants