Git Product home page Git Product logo

Comments (8)

oubiwann avatar oubiwann commented on July 3, 2024

I tried attaching erl_crash.dump, but it seems that github doesn't support attaching non-image files.

from lfe.

oubiwann avatar oubiwann commented on July 3, 2024

Forgive my newbness, but here's some more:

$ erl -pa ebin 
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]

Eshell V5.9.3.1  (abort with ^G)
1> lfe_comp:file(hello).
** exception error: no case clause matching {error,tokens}
     in function  lfe_io:with_token_file/2 (src/lfe_io.erl, line 93)
     in call from lfe_comp:file/2 (src/lfe_comp.erl, line 70)
2> 

from lfe.

rvirding avatar rvirding commented on July 3, 2024

Hi Duncan,

There shouldn't be any problems running LFE on R15B03 on a Mac as I run it on R15B also on a Mac. I use the precompiled version from Erlang Solutions, https://www.erlang-solutions.com/downloads/download-erlang-otp, though this should not make a difference.

Your first problem is that the erlang system is not finding the LFE .beam files. The lfe script is quite simple and it doesn't know where to find the binaries. You either have to give a -pa ebin argument to it as you do with erl, or use the ERL_LIBS environment variable if you have more applications you wish to find automatically. See the documentation for the code module.

Your second problem may be a bug in LFE. The LFE tokeniser is finding an error but the lfe_io module is not handling it correctly. It is rare to get errors when scanning which is probably why I haven't noticed it before. I hope. Could you please send me a copy of the "hello.lfe" file so I can fix it? If it short just include it, or you can mail it to me at [email protected].

There is also a Google group at https://groups.google.com/forum/?hl=en&fromgroups#!forum/lisp-flavoured-erlang which may be easier for discussions.

I hope this helps,

Robert

from lfe.

rvirding avatar rvirding commented on July 3, 2024

Another reason for your second problem just occurred to me. The source file for the LFE tokeniser, lfe_scan is the file lfe_scan.xrl which is meant to be run through the Erlang tool leex to generate the erlang source file lfe_scan.erl. Doing make "should " handle this correctly but if it doesn't then there may not be a compiler lfe_scan.beam in ebin. To check this try doing

erlc -o ebin src/lfe_scan.xrl

which should result in there being an lfe_scan.beam generated in ebin.

If doing make did not generate this file then I need to fix Makefile.

By the way which branch are you using, it is only 'master' which is intended for users. There are no guarantees that 'develop' is consistent.

from lfe.

oubiwann avatar oubiwann commented on July 3, 2024

Thanks, Robert! Was away for the weekend, but will following your suggestions and provide everything you asked for :-)

from lfe.

oubiwann avatar oubiwann commented on July 3, 2024

Robert, thanks again for your help. I was keeping notes for this in an email to the group, but at the end, it seems that there is something missing with the Makefile, so I'm following up here.

Here's some more info for you:

  • I am running against the "develop"
  • I did run make prior to running ./lfe
  • make did not generate lfe_scan.beam
  • the hello.lfe I used is a copy-and-paste of the one given here: https://github.com/rvirding/lfe/wiki/Get-started ("First Program")

Here's what I've done, following your suggestions from your comments on the ticket I opened:

  1. ran make clean and then make, just to double-check that lfe_scan.beam was not getting created by make
  2. ran erlc -o ebin src/lfe_scan.xrl -- but this did not generate a .beam (only a .erl)
  3. made sure that I was using erl -pa ./ebin

Attempting to run the hello.lfe like this results in the following error:

** exception error: no case clause matching {error,tokens}
     in function  lfe_io:with_token_file/2 (src/lfe_io.erl, line 93)
     in call from lfe_comp:file/2 (src/lfe_comp.erl, line 70)

Seeing that an .erl file was created with your command above, I followed that with this command:

erlc -I include -o ebin -W0 +debug_info ebin/lfe_scan.erl

And that did the trick!

Your makefoo is much stronger than mine -- I've never used something like what you're doing with "$(SRCDIR)/%.erl: %.xrl" so I don't know why it's not compiling the .xrl file first. Otherwise I would have submitted a patch, and saved you some time :-/

To summarize: when I do this first:

erlc -o src src/lfe_scan.xrl

before running make, the src/lfe_scan.erl is present and is compiled with the rest of the .erl files into the ebin dir when I run make.

from lfe.

oubiwann avatar oubiwann commented on July 3, 2024

And, with that done, I have a running repl with no errors:

./lfe -pa ./ebin

Horray! Now I can finally learn me some Erlang... ;-)

from lfe.

rvirding avatar rvirding commented on July 3, 2024

What happened was that the file lfe_scan.erl was removed from the distribution which is fine as it is a generated file. However, the Makefile wasn't modified to handle this. I will fix it so it works better. Rebar handles this auotmagically so there are no problems.

from lfe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.