GithubHelp home page GithubHelp logo

Comments (9)

willwhitney avatar willwhitney commented on May 18, 2024

This is an issue with some kernels which are janky and don't put the output in the right place. Which Javascript kernel are you using?

from hydrogen.

rgbkrk avatar rgbkrk commented on May 18, 2024

It's the IJavascript kernel I assume (I just read n-riesco/ijavascript#31).

from hydrogen.

holyjak avatar holyjak commented on May 18, 2024

Indeed

Forget software. Strive to make an impact, deliver a valuable change.

(Vær så snill og hjelp meg med å forbedre norsken min – skriftlig og
muntlig. Takk!)

Jakub Holy
Solutions Engineer | +47 966 23 666
Iterate AS | www.iterate.no
The Lean Software Development Consultancy

It's the IJavascript kernel I assume (I just read n-riesco/ijavascript#31
n-riesco/ijavascript#31).


Reply to this email directly or view it on GitHub
#52 (comment)
.

from hydrogen.

n-riesco avatar n-riesco commented on May 18, 2024

Hi everyone,

I've tried to reproduce this issue and I've noticed that:

  • if I don't save the document before pressing ctrl-alt-enter, no output is shown (only a looping icon).
  • if I save the document, then I get the result of calling console.log("Hello, Jupyter"), which is undefined, but I don't see the text written to process.stdout.

from hydrogen.

n-riesco avatar n-riesco commented on May 18, 2024

I've quickly skimmed through Hydrogen's code. If I understood correctly this, when a kernel returns a result, Hydrogen doesn't show what was written to stdout.

I'm planning to add a flag to IJavascript to let the user silence undefined results (so that it plays nicely with Hydrogen). Most likely, I will make this the default behaviour.

from hydrogen.

holyjak avatar holyjak commented on May 18, 2024

I like the way Light Table works: returning the result of the statement
(even if being undefined) and having a separate output view where I can go
check for side effects. Though anything is much better than nothing :)

Forget software. Strive to make an impact, deliver a valuable change.

(Vær så snill og hjelp meg med å forbedre norsken min – skriftlig og
muntlig. Takk!)

Jakub Holy
Solutions Engineer | +47 966 23 666
Iterate AS | www.iterate.no
The Lean Software Development Consultancy

I've quickly skimmed through Hydrogen's code. If I understood correctly this
https://github.com/willwhitney/hydrogen/blob/2d2ae6e49e556a45c39231c758dd57afda56202d/lib/result-view.coffee#L78,
when a kernel returns a result, Hydrogen doesn't show what was written to
stdout.

I'm planning to add a flag to IJavascript to let the user silence undefined
results (so that it plays nicely with Hydrogen). Most likely, I will make
this the default behaviour.


Reply to this email directly or view it on GitHub
#52 (comment).

from hydrogen.

willwhitney avatar willwhitney commented on May 18, 2024

@n-riesco That's not where that logic is, but you're basically right. My reading is that kernels are supposed to put their stdout in the io stream: http://ipython.org/ipython-doc/stable/development/messaging.html#streams-stdout-stderr-etc

I'll look into the issue with not getting results until the file is saved.

@jakubholynet I agree in principle with separating those concerns, but due to kernel variability this is not feasible. Some kernels put all their results in the io stream, some put them into an execute_reply, etc. Right now my strategy is to just copy Jupyter's behavior of showing all the results.

from hydrogen.

n-riesco avatar n-riesco commented on May 18, 2024

@willwhitney IJavascript does send stdout to the IOSocket (as IPython and IJulia do). The difference is that whereas IJavascript returns undefined results, IPython drops Nones and IJulia drops nothings.

from hydrogen.

n-riesco avatar n-riesco commented on May 18, 2024

@jakubholynet This is issue is solved in IJavascript v5.0.3 (now available from npm)

@willwhitney This issue turned out to be solved by the PR you sent me last time. Unfortunately, I hadn't made it available on npm.

I'm sorry for all the inconvenience.

from hydrogen.

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.