Code Monkey home page Code Monkey logo

Comments (7)

stisa avatar stisa commented on September 21, 2024 1

Having nim evaluate the code is an interesting idea, but the main reason I didn't implement that is graphs, as far as I know none of the plotting libraries work in the vm (ok, technically nim-plotly might work), and similarly numerical libraries.
Since that was my main use for this, I ended up with compiled nim. It should be relatively easy, just a matter of changing nim c to nim e.
Other option for faster cell execution is using https://bellard.org/tcc/ as the C compiler (this should work with most of nim) or feeding single lines to nim secret. I'll hopefully have time soon to update zmq code to work with the latest version, so maybe I'll give some of this a try.

Of course, any help is appreciated! And hearing from users is always very helpful to find bugs that just don't appear on my system.

from jupyternim.

voidpunk avatar voidpunk commented on September 21, 2024

What about giving the possibility to use Nimscript instead of compiled Nim? Even if still limited it can handle almost all the standard libraries and would be great for people just learning and experimenting Nim, the cells would execute way faster.

P.S. I can help with the less programming-intensive part (for sure with the Logo).

from jupyternim.

voidpunk avatar voidpunk commented on September 21, 2024

Indeed Arraymancer and other libraries don't work on Nimscript, but it would be a great way for newbies to learn the basis of the language and of the standard library without having to wait 5-30 seconds for each cell. It would be nice to just have the option as alternative to the default compilation.

I would also report a issue I found: I receive the error "Kernel is dead" whenever I try to pass the flag #>flags --c:tcc.

Last but not least, I made a logo. Tell me if you like the idea or if you want me to modify something. However, it's made only for dark websites. It's thought for Github on dark mode, so it has white elements and transparent background, but I can easily made other versions once it is approved 🙂
JupyterNim

from jupyternim.

stisa avatar stisa commented on September 21, 2024

Hey! Sorry for not getting back to you, thanks for reporting a bug, I'll look into it.
About the logo, nice work! What about using the crown instead of the orange parts? So it would just be Jupyternim superimposed on the crown, with the moons orbiting around it. I think that would look cleaner?

from jupyternim.

iacore avatar iacore commented on September 21, 2024

What about using inim? They are better at interactive stuff already.

nim>1
1 == type int
nim> 2
2 == type int
nim> 

It has "hot reload" too. It compiles the imported file again on every REPL loop.

from jupyternim.

stisa avatar stisa commented on September 21, 2024

Hey! Thanks for the comment. Jupyternim and inim work the same under the hood, or at least they did last time I checked. Neither implements hcl as it's still too buggy on the nim side.
Switching to use inim doesn't seem to offer much benefit, compiling a cell is already slow, and switching from direct jupyter>nim>result to jupyter>inim>nim>result would probably make it worse.
I'll see if I can provide a way to select the compiler, that way you could just run your code with nim or inim by changing a flag.
The convenience of seeing value and type of the value is something we could probably add, although I'd prefer the type in the tooling part (eg with nim suggest) instead of the reply

from jupyternim.

iacore avatar iacore commented on September 21, 2024

inim's support for directly showing the expression value is buggy. A multiline expression will fail:

import sugar, sequtils

collect(newSeq):
  for i in 0..3:
    i

from jupyternim.

Related Issues (13)

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.