Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Chunk – Code sandbox for back-end devs (chunk.run)
96 points by theochampion on July 29, 2022 | hide | past | favorite | 35 comments
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!



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!


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)


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)


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.


Good question! We use the Deno (https://deno.land) runtime which comes with built it permissions mgmt


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


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!


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.


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?


> 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?


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


not a trivial concept*


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.


Good catch! Thanks for the heads up, I will get right on it!


The fix should be up now.


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.


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


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


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.


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.


This looks really cool! Just a heads up I sent a message to the chunk Twitter account about a small problem I noticed.


Saw your message, thanks again for the heads up!


This is amazing, how do I access the HTTP request query parameters and headers?


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?


Authentication, mainly.



Thank you!


Is this kinda like Integromat meets Cloudflare Workers?


Yes, thats a pretty good way to summerize it!


This looks great, but what is the actual purpose?


Looks like a faas.


Neat will check it out later!

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

"Scrap the web"


I was kinda hoping it was a rallying cry. "Scrap the web! We can do better!"


Ah! Thanks for the heads up!


Also "Scrapping"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: