Live data from Hacker News

Show HN: A simple JavaScript notebook in one file

github.com

21–30 of 35 posts

Re: Show HN: A simple JavaScript notebook in one file

#21
post #14

Congratulations, I like the idea, quite useful for learning JS I think ;)

I've had the idea that this could be useful for an introduction to programming. All you need is a browser. It also could encourage a more "literate" style of programming, much like Jupyter notebooks.

Re: Show HN: A simple JavaScript notebook in one file

#22
post #19

Unfortunately I've yet to grasp what a "notebook" is. ("Jupyter"??) I did try googling and reading about it.

Exactly this! I have no clue what it means and googeling for its gives me "live editor". To me a notebook (in terms of computers) is a small laptop.

HN enlighten us!

Re: Show HN: A simple JavaScript notebook in one file

#23
Very cool, I'm building something similar (with a larger scope) [0] (it also has one-file exports, but it does load stuff from a CDN so it's not as contained to a single file as this project is.)

If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from "https://some-url.com/bla.js"` syntax at the top of cells. Here's how:

   const exportsInCell = await import(URL.createObjectURL(new Blob([USER_CODE], { type: "text/javascript" })));

And with some transpilation you can support top-level await in eval [1]. Just some pointers!

[0]: https://starboard.gg & https://github.com/gzuidhof/starboard-notebook

[1]: https://github.com/gzuidhof/starboard-notebook/blob/master/s...

Re: Show HN: A simple JavaScript notebook in one file

#24

Earlier quoted context omitted.

If you download and open up the html file, it contains, what is essentially, a screenshot with explanations. (A very simple screenshot, but one you can extrapolate from.)

But that requires us downloading and opening it. A lot of effort if one just wants to take a quick look. A screenshot or demo would be better.

Come on. Two clicks !== a lot of work

Re: Show HN: A simple JavaScript notebook in one file

#25
post #19

Unfortunately I've yet to grasp what a "notebook" is. ("Jupyter"??) I did try googling and reading about it.

Jupyter notebooks are a very popular development environment for data science and related fields because they provide a great tight feedback loop for experimentation and iteration. Essentially the main difference from a typical dev environment is that there are "cells" of code that you can run individually, and the program "state" is persistent. There's definitely a better way to explain it, because that doesn't sound very big, but it really is a game changer for a lot of workflows. They run python by default, but there are integrations for many other languages. Over the last few years, many alternatives and versions from different companies have been released with various differences and features (i.e. Google Colab, Kaggle, ObservableHQ for a JS version with lots of extra features, and tons of others I'm sure).

So at this point people have come to call this concept in general a "notebook". Basically a development environment with cells where you can add markup and HTML and stuff.

Hope that helped a bit.

Re: Show HN: A simple JavaScript notebook in one file

#26

Very cool, I'm building something similar (with a larger scope) [0] (it also has one-file exports, but it does load stuff from a CDN so it's not as contained to a single file as this project is.) If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from " https://some-url.com/bla.js "` syntax at th…

You project looks very interesting. Shared idea of programming in the browser, but much more ambitious.

I have experimented with async/await with js+help.html.

The import pointer is very interesting, thank you for that.

My impulse is to try to write a function to import a code from a URI.

Re: Show HN: A simple JavaScript notebook in one file

#27

Very cool, I'm building something similar (with a larger scope) [0] (it also has one-file exports, but it does load stuff from a CDN so it's not as contained to a single file as this project is.) If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from " https://some-url.com/bla.js "` syntax at th…

I never get an email confirmation when I try to sign up for Starboard :(

Edit: Suddenly got both!

Re: Show HN: A simple JavaScript notebook in one file

#28

Earlier quoted context omitted.

If you download and open up the html file, it contains, what is essentially, a screenshot with explanations. (A very simple screenshot, but one you can extrapolate from.)

You can instead use githack[1] to quickly serve files directly from your repository. [1]: https://raw.githack.com

Another very useful pointer. Thank you.

I wonder what "Files are automatically optimized" means, exactly?

Have tried this out.

(See comment https://news.ycombinator.com/item?id=27452226)

Re: Show HN: A simple JavaScript notebook in one file

#29

would it be accurate to describe a notebook as a gui for a repl?

Pretty much. Notebooks can also be saved for running later. And since they also generally support markdown, it doubles as documentation.

Well put.

For simplicity, in js+help.html, not markdown, but plain HTML.

Re: Show HN: A simple JavaScript notebook in one file

#30

This is a very simple Javascript notebook in one completely self-contained HTML file. It was inspired by the concept of Jupyter notebooks. You can enter Javascript code and execute it in the browser, completely locally and possibly offline. The performance can be pretty good. You can put in HTML documentation and also use HTML to provide UI for simple tools. All you need is the js+help.html file, which contains basic…

Thanks to freeCandy and the githack service, here is a link that can be directly used:

https://rawcdn.githack.com/timcwinkler/javascript-notebook/9...

(There must be some resource limits, but I don't know what they are. Maybe there aren't limits? This is fast.)

Post reply on HN