Fork me on GitHub
#nbb
<
2022-07-05
>
ray14:07:58

@borkdude I notice that some of the examples have nbb in package.json and others do not. What's the general advice? Install it globally each time to get the updates or pin it to an (always old :rolling_on_the_floor_laughing: ) version?

valtteri16:07:10

My preference is to not install anything from npm globally and always run executables from project node_modules with npx . It’s a way to suffer 3% less JS-fatigue

👍 3
borkdude17:07:57

If you install nbb locally, this is the fastest way to run it, if you care about startup time:

node_modules/.bin/nbb -e '(+ 1 2 3)'

lispyclouds21:07:21

Another potential js target for sci? https://bun.sh/

👍 4
delaguardo07:07:11

isn’t it just a “normal” js runtime?

delaguardo07:07:37

sci should work with it just fine

lispyclouds07:07:44

Yeah like #bebo this could be another thing. Performance numbers look nice and interestingly uses javascriptcore not v8

delaguardo07:07:06

still feels kind a “yet another SPA framework every hour” situation few years ago 🙂 but for now it is “yet another JS runtime” just two weeks ago I found this - https://hermesengine.dev/

lispyclouds07:07:06

Yeah pretty much. True for the whole js ecosystem I feel. I'm just thinking where and how more clj(s) can be snuck into 😆

lispyclouds07:07:02

Also the current trend seems to be with things like jsx, ts etc is to compile on the fly and not precompile. Both deno and bun favour this.

borkdude08:07:40

It's interesting, thanks for sharing

borkdude08:07:49

Where did you hear about bun? I completely missed this

borkdude08:07:03

Oh, it's 2 on hackernews now ;)

borkdude08:07:09

I'm trying out bun + nbb now. It seems to work... ish

borkdude09:07:59

So, this works in bun:

// loadFile is silently failing in bun, so we use loadString instead:
import { loadString } from 'nbb'

const code = await Bun.file('index.cljs').text();

await loadString(code);

catjam 1
lispyclouds09:07:34

> Where did you hear about bun? From the same nvim person I told you about, also a name in js/ts world from Netflix 😄 he was doing a live hack on it yesterday before it got open sourced

borkdude10:07:31

Published a new version of nbb which fixes the readFile issue and updated the docs

lispyclouds10:07:54

do you see any significant perf difference? this is a different js engine after all

borkdude10:07:29

startup with bun run nbb is much faster than say npx nbb . Haven't measured actually performance. Going to try the loop example now

borkdude10:07:43

I think the most benefits I see is the much faster npm tooling

lispyclouds10:07:05

right, i guess the focus is on fast startup for edge computing than runtime perf

lispyclouds10:07:37

is it in the bb ballpark for startup times 😛 ?

borkdude10:07:29

I'm at around 100ms now for nbb, about 50ms is from Node itself

borkdude10:07:35

And with deno compile I'm at 80ms

borkdude10:07:46

But bb is still the king of startup ;)

babashka 3
borkdude10:07:37

I have some places where I can cut some JS size from the bundle still, so more speedups coming. Will never be faster than node startup time because I can't cause negative startup time

wizard 1
borkdude19:07:19

Anyone played with nbb + bun + bun:ffi yet? ;)