News for hackers. Stuff that matters.
Re:Show HN: Observable Notebooks by danso on Wednesday January 31, 2018 @11:33AM (#16275101)
Just in case people were wondering, the site seems to have been overwhelmed for the past 10-15 minutes. But there's a YouTube demo of the tech https://news.ycombinator.com/item?id=16275040

I guess an oversimplified description would be that this is like a Jupyter Notebook specifically for JavaScript. Libraries like D3 are pre-loaded and immediately accessible. Am definitely interested in hearing the details about what it is built with and medium to long-term plans for the service.

Note that the Jupyter Notebook service generally requires you to be installing and running Python etc. on your own computer. Jumping into an Observable notebook is as easy as opening your browser and signing in via GIthub

Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @12:00PM (#16275323)
I wrote more about the motivation for Observable (formerly d3.express) last year: https://medium.com/@mbostock/a-better-way-to-code-2b1d2876a3...

It’s easy to use D3 within Observable, but it’s not pre-loaded or specifically built-in. Any browser library published to npm can be loaded via require (for AMD) or dynamic import (for ES modules). I’ve published a bunch of notebooks with D3 but you’ll find other ones with THREE.js, Vega-Lite, Leaflet and other libraries.

Re:Show HN: Observable Notebooks by arnioxux on Wednesday January 31, 2018 @02:19PM (#16276678)
Are the language/syntax differences documented somewhere? It's difficult to tell if something is an obscure early stage ecmascript proposal or a language feature specific to observablehq. For example in https://beta.observablehq.com/@mbostock/introduction-to-note...

  import {canvas as flood} with {height} from "@mbostock/randomized-flood-fill"
or how you define generators

  i = {
    let i = 0;
    while (true) {
      yield ++i;
    }
  }
etc
Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @02:29PM (#16276771)
We’re still writing more documentation, but there’s a bit more detail here (and I’ll be posting more soon): https://beta.observablehq.com/@mbostock/introduction-to-code

To summarize, the body of a cell is typically either an expression or a block statement, akin to the body of an arrow function. If a cell starts with name = …, then it has a name and can be referenced by other cells. So, the name = part is specific to Observable, but the expression and block statement is normal JavaScript.

The import declaration is similar to a normal static ES import, but the with clause allows you to inject local definitions into the imported notebook.

Re:Show HN: Observable Notebooks by dunham on Wednesday January 31, 2018 @06:02PM (#16278357)
I got a little tripped up because I tried to assign a literal object to a name.

e.g.

    name = { foo: 1 } 
doesn't work. I ended up doing:

    name = { return { foo: 1} }
but after your explanation, I guessed that this would also work:

    name = ({ foo: 1})
Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @06:35PM (#16278565)
Yep!
Re:Show HN: Observable Notebooks by d0mine on Wednesday January 31, 2018 @10:14PM (#16279417)
There is mybinder.org to run jupyter notebooks online . For example, https://github.com/norvig/pytudes
Re:Show HN: Observable Notebooks by Hex-3-En on Thursday February 01, 2018 @04:13AM (#16280501)
There's also some (currently) free cloud version by microsoft available on https://notebooks.azure.com in a preview state, but works great already. (Tested python3 only)
Re:Show HN: Observable Notebooks by goatlover on Wednesday January 31, 2018 @12:50PM (#16275801)
There's a reason why you would want to run Python and that's the huge, well supported scientific computing libraries it has.
Re:Show HN: Observable Notebooks by tmcw on Wednesday January 31, 2018 @01:07PM (#16275965)
Absolutely! We all quite like Python, and there's no denying that JavaScript doesn't have the same caliber and range of scientific code (yet!).

I fully expect plenty of people to do some of the data-crunching in Python, Julia, R, and so on, and bring it into Observable to explore and experiment. And I also expect JavaScript's ecosystem to blossom, especially with WebAssembly & WebGL hitting the mainstream.

Re:Show HN: Observable Notebooks by goatlover on Wednesday January 31, 2018 @02:31PM (#16276791)
No doubt you're right, but I don't think JS is well suited for scientific computing. At least Python gives you operator overloading. Julia and R are designed for this field. It's better for JS to remain on the presentation side for anything sophisticated.
Re:Show HN: Observable Notebooks by colbyh on Wednesday January 31, 2018 @02:42PM (#16276881)
Forgive me if I read the response wrong but that seems like exactly what the author is saying? Do your computing in Python/R, export a generated CSV, and then present it in Observable?
Re:Show HN: Observable Notebooks by goatlover on Wednesday January 31, 2018 @02:58PM (#16276999)
With the possibility that WebAssembly and WebGL will make the libraries in Python/R available to JS. Which might be alright. You probably won't be able to utilize vectorization with operators.
Re:Show HN: Observable Notebooks by stochastic_monk on Wednesday January 31, 2018 @01:25PM (#16276162)
What’s the status of d3 ports to Python? I believe plotly, d3py, and Bokeh all offer some amount of support.

I’d expect more python users to bring d3 in that bring python to JavaScript.

Re:Show HN: Observable Notebooks by thousandautumns on Wednesday January 31, 2018 @01:09PM (#16275988)
The point wasn't that there is something wrong with Python, the point was that Jupyter requires local installation whereas Observable doesn't require installation of any kind.
Re:Show HN: Observable Notebooks by danso on Wednesday January 31, 2018 @01:12PM (#16276024)
Yep, Python is my language for work and teaching, especially for data projects. Doesn't mean I don't envy the interactivity and visualization potential working in JS.
Re:Show HN: Observable Notebooks by peatmoss on Wednesday January 31, 2018 @01:19PM (#16276095)
I was just thinking about a proliferation of Javascript statistical libraries popping up... only an NPM away. And I shuddered a little.

And then it occurred to me that CRAN and NPM have a fair bit in common. Both have a package for anything you might imagine, and both have a mix of amazing and less-than-amazing quality.

[dead]
Re:Show HN: Observable Notebooks by Yizahi on Thursday February 01, 2018 @06:41AM (#16281131)
> ".edu email required"

So USA-centric. My second biggest university in Ukraine (50k students) doesn't have any .edu domains and certainly didn't supply them to the students. Same as first biggest university and just about every other in the country, they all use regional or other general domains.

Re:Show HN: Observable Notebooks by acosmism on Thursday February 01, 2018 @01:51PM (#16284554)
they support international edu emails as well. have you tried signing up?
Re:Show HN: Observable Notebooks by Yizahi on Friday February 02, 2018 @06:43AM (#16289833)
I meant that in my country (Ukraine) I can't get any .edu domain or email for any money even if I was student. Our universities use .ua domains and subdomains like .org.ua, .com.ua etc. Also in our universities usually students aren't issued any emails.
Re:Show HN: Observable Notebooks by acosmism on Saturday February 03, 2018 @09:19AM (#16297703)
yes what im saying is that they support non-“.edu” domains for recognized international schools. try signing up and see what plan you end up with
Re:Show HN: Observable Notebooks by eoinmurray92 on Wednesday January 31, 2018 @07:41PM (#16278876)
There are a few ways to open Jupyter notebooks in the cloud pretty easily:

https://aws.amazon.com/sagemaker/

https://cloud.google.com/datalab/

https://gryd.us/

https://kyso.io (disclaimer - I'm a founder)

Do you want it to be so easy that you jump into the notebook immediately upon logging in, the hard part is that javascript will run in your browser - but python or R need a kernel running somewhere?

Re:Show HN: Observable Notebooks by aw3c2 on Wednesday January 31, 2018 @12:41PM (#16275701)
There are many online services for hosted Jupyter Notebooks. mybinder, Google, Intel, Microsoft etc etc
Re:Show HN: Observable Notebooks by KyleOS on Wednesday January 31, 2018 @09:22PM (#16279273)
There's also Anaconda, Dominodatalab, R-Brain, Kyso (currently in the Techstars NYC '18 program) - disclaimer, I'm part of this project.
Re:Show HN: Observable Notebooks by make3 on Wednesday January 31, 2018 @10:26PM (#16279459)
Google colab allows to create Python notebooks and run them (directly on Google cloud) without paying anything, or setting anything up
Re:Show HN: Observable Notebooks by mynewtb on Thursday February 01, 2018 @05:01AM (#16280655)
Except you need a Google account I presume.
Re:Show HN: Observable Notebooks by avip on Wednesday January 31, 2018 @03:27PM (#16277250)
So it's "databricks for JS" ?
Re:Show HN: Observable Notebooks by anentropic on Thursday February 01, 2018 @07:43AM (#16281439)
if you're going to be using an online hosted service ("sign in via GitHub") then you don't need to install and run Python to use a Jupyter Notebook...