News for hackers. Stuff that matters.

Show HN: Chunk – Code sandbox for back-end devs

https://chunk.run

Chunk co-founder here. We spent the last 2 weeks building this to scratch our own itch:

As developers, we often have problems that could be solved just by running a few lines of code. Sometimes, running this code on your local machine is fine. But other time, the code need to run automatically reacting to external events or to run continuously, which means, it needs to run on a server somewhere.

So now, you have to find a cloud provider, to package or build the code and finally to deploy it. All of that for what could be literally be 4 lines of code.

We couldn’t find an easier way to do this, so we built it.

Chunk is an all in one web editor (think of the codesandbox experience) that allows you to write, deploy and run a piece of code in the cloud from a variety of triggers: HTTP, WebHook, manual or scheduled (cron).

No setup, no build, no deploy. Chunk makes you go from idea to code running in the cloud in seconds.

Let me know what you guys think!

( 35 comments | 96 points | on HN )
Re:Show HN: Chunk – Code sandbox for back-end devs by dsanchez97 on Friday July 29, 2022 @03:37PM (#32280957)
I really like yalls website design and UX; especially around scheduling the functions to run. I am working on the same problem in Python space at https://cdevframework.io, but I am building it first as a client side SDK. Mostly chose that way because I don't have much frontend skills! Impressive that you could getting this up and going so quickly!
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @08:14PM (#32283120)
Thanks! I really like your client side SDK approach, giving users the ability to use their own IDE / tools is always a plus. (+ building a web IDE is a pain haha)
Re:Show HN: Chunk – Code sandbox for back-end devs by bluelightning2k on Friday July 29, 2022 @03:46PM (#32281037)
How do you safely run untrusted user code?

Thanks for building this.

(Won't use it personally as being a pro developer I'd always use my existing cloud provider)

Re:Show HN: Chunk – Code sandbox for back-end devs by z3t4 on Friday July 29, 2022 @05:00PM (#32281714)
In nodejs you can use the vm module. And for extra layers you can run node itself in a linux namespace aka container. Inside a VPS that has selinux. On a dedicated server with no LAN access besides the gateway. In a fireproof datacenter.
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @05:20PM (#32281908)
Good question! We use the Deno (https://deno.land) runtime which comes with built it permissions mgmt
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Saturday July 30, 2022 @01:09PM (#32288390)
If we were to support more runtimes, I think I'd go for Firecracker (https://github.com/firecracker-microvm/firecracker/) which is what AWS uses for lambdas
Re:Show HN: Chunk – Code sandbox for back-end devs by bluehatbrit on Friday July 29, 2022 @04:04PM (#32281217)
How does this compare to glitch.com? As far as I can tell the only real difference is the support for scheduled jobs, but I feel like I'm probably missing something more fundamental. Maybe it's just trying to be better version? Looks cool none the less, will check it out!
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @05:26PM (#32281959)
Glitch is definitely the closest in terms of usage. We in fact used Glitch ourselves quite a lot. But even running the simplest piece of code on Glitch still requires you to write all the boilerplate code (e.g. setting up a node express HTTP server).

And of course, Glitch stops every instances after 5min of inactivity and it takes a solid 30sec to wake them up after.

Glitch is unbeatable in the frontend part. But we want to make the backend dev experience more seamless.

Re:Show HN: Chunk – Code sandbox for back-end devs by bluehatbrit on Monday August 01, 2022 @08:46AM (#32305182)
The 5min inactivity shut down is only for free accounts though, is chunk going to continue to run my app 24/7 on a free tier?

The boilerplate code part sounds interesting, so chunk is also a bit of a framework? That's really nice, could speed up development a lot more. You're totally right about glitch taking a while to get going with. Does that framework restrict users in anyway, can it be ignored?

Re:Show HN: Chunk – Code sandbox for back-end devs by masukomi on Friday July 29, 2022 @04:07PM (#32281257)
> But other time, the code need to run automatically reacting to external events or to run continuously, which means, it needs to run on a server somewhere.

why couldn't this be solved much more easily with ngrok or one of its competitors?

Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @05:19PM (#32281894)
Ngrok and reverse proxies in general are an option. But it's a trivial concept, and you'd still need to run your machine 24/7
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @07:39PM (#32282917)
not a trivial concept*
Re:Show HN: Chunk – Code sandbox for back-end devs by nickphx on Saturday July 30, 2022 @12:12PM (#32287891)
I noticed a 'bug'. If you click 'New chunk' from the 'Explore' page you're taken to /c/new without a session and will end up at a blank page.

Navigated to https://chunk.run/c/new 09:11:33.510 [slug]-844c1730038cbd0f.js:1 got user sessions null 09:11:33.517 [slug]-844c1730038cbd0f.js:1 Creating new chunk. 09:11:33.517 [slug]-844c1730038cbd0f.js:1 No user logged in.

Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Saturday July 30, 2022 @12:13PM (#32287905)
Good catch! Thanks for the heads up, I will get right on it!
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Saturday July 30, 2022 @12:17PM (#32287934)
The fix should be up now.
Re:Show HN: Chunk – Code sandbox for back-end devs by zoomzoom on Saturday July 30, 2022 @06:30PM (#32291007)
This is awesome and in general I couldn’t be more excited about platforms that integrate the loop from building to deploying in one place. Similar tools include glitch, replit, codesphere.

I’m the cofounder of Coherence (withcoherence.com) which is in early beta to bring the same experience to a more typical VSCode cloud IDE/infra as code in your own cloud/CI setup that a software team working on full stack containerized apps would use.

Re:Show HN: Chunk – Code sandbox for back-end devs by nlitened on Friday July 29, 2022 @07:16PM (#32282768)
I think that’s a neat idea because I’ve been wanting something like this for several weeks :)

Please consider adding ClojureScript via nbb[0] as a language option.

[0] https://github.com/babashka/nbb

Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @07:26PM (#32282839)
Cool! What would be your usages if you don't mind sharing?

First time hearing about nbb, its cool, I will definitely look into it

Re:Show HN: Chunk – Code sandbox for back-end devs by nlitened on Friday July 29, 2022 @07:39PM (#32282913)
Sure.

I use Make.com (former Integromat) for many automations for my small business, and while quite handy, the automations are cumbersome to edit and very limited. Pretty often I have to resort to something dumb like composing a complex JSON by hand or using a third-party web-service token just to unzip a file. Sometimes I rage too much, wanting to rewrite the whole script of visual blocks in four simple lines of Clojure, but the complexity of deploying that four-lines webhook (or scheduled task) online cools me down pretty quickly, and I just give up.

Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @08:08PM (#32283080)
Thanks for sharing!

The no-code approach taken by these automation apps (Make, Zapier..) makes them super accessible, but i agree, when any kind of business logic is involved nothing beats a few lines of code.

You could setup a Chunk as only one "step" of a Make/Zapier workflow. Giving you code-control only where you need it.

We could probably make that even easier by building integration for Make and Zapier.

Re:Show HN: Chunk – Code sandbox for back-end devs by throwaway893483 on Friday July 29, 2022 @05:54PM (#32282217)
This looks really cool! Just a heads up I sent a message to the chunk Twitter account about a small problem I noticed.
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Saturday July 30, 2022 @01:07PM (#32288368)
Saw your message, thanks again for the heads up!
Re:Show HN: Chunk – Code sandbox for back-end devs by sscarduzio on Saturday July 30, 2022 @01:00PM (#32288317)
This is amazing, how do I access the HTTP request query parameters and headers?
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Saturday July 30, 2022 @01:06PM (#32288363)
There is currently no way to access the HTTP request query params and headers, but we could add it (probably as part of the context obj).

What is your use-case if you don't mind me asking?

Re:Show HN: Chunk – Code sandbox for back-end devs by sscarduzio on Saturday July 30, 2022 @01:30PM (#32288580)
Authentication, mainly.
Re:Show HN: Chunk – Code sandbox for back-end devs by theo_champion on Thursday August 04, 2022 @10:05AM (#32343074)
Re:Show HN: Chunk – Code sandbox for back-end devs by sscarduzio on Thursday August 04, 2022 @10:17AM (#32343227)
Thank you!
Re:Show HN: Chunk – Code sandbox for back-end devs by solardev on Saturday July 30, 2022 @01:33PM (#32288614)
Is this kinda like Integromat meets Cloudflare Workers?
Re:Show HN: Chunk – Code sandbox for back-end devs by theo_champion on Monday August 01, 2022 @02:36PM (#32310315)
Yes, thats a pretty good way to summerize it!
Re:Show HN: Chunk – Code sandbox for back-end devs by dennisy on Friday July 29, 2022 @03:33PM (#32280914)
This looks great, but what is the actual purpose?
Re:Show HN: Chunk – Code sandbox for back-end devs by rad_gruchalski on Friday July 29, 2022 @06:16PM (#32282391)
Looks like a faas.
Re:Show HN: Chunk – Code sandbox for back-end devs by hemloc_io on Friday July 29, 2022 @03:26PM (#32280835)
Neat will check it out later!

Wanted to leave a comment b/c you have a typo on the front page.

"Scrap the web"

Re:Show HN: Chunk – Code sandbox for back-end devs by masukomi on Friday July 29, 2022 @03:56PM (#32281135)
I was kinda hoping it was a rallying cry. "Scrap the web! We can do better!"
Re:Show HN: Chunk – Code sandbox for back-end devs by theochampion on Friday July 29, 2022 @05:45PM (#32282127)
Ah! Thanks for the heads up!
Re:Show HN: Chunk – Code sandbox for back-end devs by xnx on Friday July 29, 2022 @03:55PM (#32281129)
Also "Scrapping"