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

Base repo #38

Open
MartinNowak opened this issue May 27, 2016 · 5 comments
Open

Base repo #38

MartinNowak opened this issue May 27, 2016 · 5 comments

Comments

@MartinNowak
Copy link
Collaborator

Issue by wilzbach
Wednesday May 25, 2016 at 19:15 GMT
Originally opened as https://github.com/drepl/drepl-old/issues/1


  1. drepl
  • uses libdparse to parse the structure, pipes everything to a temporary file and runs rdmd on it
  • uses liblineoise for the terminal interaction (small C lib)
    2) dabble
  • defines its own grammer & parser (via pegged)
    • uses union and Var structs to ship it's own a JIT compiler (with libdparse)
    1. From scratch

dabble's approach looks generally good and more scalable, but I have no idea how one can import custom packages in there

@MartinNowak
Copy link
Collaborator Author

Comment by carljv
Wednesday May 25, 2016 at 20:29 GMT


Did you get dabble to compile? Relying on the lexer/parser in libdparse feels better to me, since it gives you consistency with the whole DScanner, DCD, dfmt, ecosystem. Is there any reason to prefer the pegged approach?

I haven't dug really deeply into this, but it seems like both of these require making/using shared libs. Is that a blocker for OS X?

Thanks for picking this up, I think it will be really useful, as well as a nice component of "the first five minutes."

@MartinNowak
Copy link
Collaborator Author

Comment by wilzbach
Wednesday May 25, 2016 at 20:37 GMT


Did you get dabble to compile?

Nope :/

Relying on the lexer/parser in libdparse feels better to me, since it gives you consistency with the whole DScanner, DCD, dfmt, ecosystem. Is there any reason to prefer the pegged approach?

I think both REPLs use libdparse, but dabble uses pegged for it's own Meta command

https://github.com/callumenator/dabble/blob/master/src/dabble/grammars.d
https://github.com/callumenator/dabble/blob/master/src/dabble/parser.d
https://github.com/callumenator/dabble/blob/master/src/dabble/meta.d#L26

which makes it more powerful (in theory - as said I couldn't compile).

I haven't dug really deeply into this, but it seems like both of these require making/using shared libs. Is that a blocker for OS X?

Nope, but we should be aware that compiling the external lib can require more effort.
E.g. for linenoise you currently have to run

curl -sSL https://github.com/antirez/linenoise/archive/master.tar.gz | tar -zxf -
cd linenoise-master && cc -shared -fPIC linenoise.c -o liblinenoise.so

Of course a good Makefile can deal with all this, but currently dub is the package manager and standard build tool.

Thanks for picking this up, I think it will be really useful, as well as a nice component of "the first five minutes."

Great to hear that you share my opinion :)

@MartinNowak
Copy link
Collaborator Author

Comment by wilzbach
Wednesday May 25, 2016 at 20:49 GMT


Pinging @John-Colvin - the author of PydMagic.
John: we are trying to bundle forces to create a great REPL and Jupyter kernel for D.

@MartinNowak
Copy link
Collaborator Author

Comment by carljv
Wednesday May 25, 2016 at 23:51 GMT


Ah. Yes, meta commands are nice. It's not clear to me that an actual grammar w/ parser is necessary for them. But I'd have to think about it harder.

@MartinNowak
Copy link
Collaborator Author

MartinNowak commented May 27, 2016

Meta commands could simply use :help or :dub vibe.d, no fancy parser needed.

Also see #6

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

1 participant