Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Running doto example from docs will fail with SyntaxError #21

Open
justuswilhelm opened this issue Mar 24, 2016 · 3 comments
Open

Running doto example from docs will fail with SyntaxError #21

justuswilhelm opened this issue Mar 24, 2016 · 3 comments

Comments

@justuswilhelm
Copy link

If I run the following in a cell,

(doto [] (.append 1) (.append 2) (.reverse))

I am getting

File "<ipython-input-40-795e246419e1>", line 2
    :G_1248 = []
    ^
SyntaxError: invalid syntax

back.
I'm using

hy-kernel==0.3.0

and hy latest (from Git) @c3004ee0b11e917fd2fb07a055d201c513d7620f

@bollwyvl
Copy link
Owner

Thanks! I think for hy_kernel to be what it can be, we'll need to go deeper
on the kernel model. I'll be on-site with the Jupyter/IPython core team
next week, and will discuss/lobby for getting an AST-driven kernel
execution mode made available, which would no doubt be interesting for many
types of DSL kernels.

On Thu, Mar 24, 2016 at 10:25 AM Justus Perlwitz [email protected]
wrote:

If I run the following in a cell,

(doto [](.append 1) (.append 2) (.reverse))

I am getting

File "", line 2
:G_1248 = []
^
SyntaxError: invalid syntax

back.
I'm using

hy-kernel==0.3.0

and hy latest (from Git) @c3004ee
c3004ee


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#21

@justuswilhelm
Copy link
Author

That sounds great, thanks for your answer. If you need any help, please let me know. Hy_kernel is a very valuable tool to me, so I'd love to help you push this project forward.

@bollwyvl
Copy link
Owner

@justuswilhelm hey, I'm really glad you are interested!

Unfortunately, I did it to learn hy, to learn a lisp, which is probably not the best person to have in the drivers' seat for vision! I'll try to put something down as to what the current challenges are, but the takeaway is:

  • the IPython kernel, which HyKernel subclasses, expects a string
    • this is partially to do magic stuff
  • hy wants to do stuff to the AST
  • so we need a way to do "just enough" string based stuff so you can use matplotlib, or something like that
    • and figure out how to get the ast directly into the shell

Of course, the righteous thing to do is to write a kernel from the ground up in hy that works with the kernel spec natively... but it's hard to give up so much from being able to ride the coattails of ipython, which always has the best jupyter stuff first (though scala is pretty intense). Perhaps there is a happy middle point... but any feedback is welcome!

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

No branches or pull requests

2 participants