332 points · by stevekrouse · 3y ago · 71 comments
We're a startup of 4 people, mostly in NYC. We've been working on this for 6 months and are eager for feedback from the HN community.
Why do we need yet another online coding IDE? While researching devtools[1], I found myself wanting something halfway between Replit and Zapier: a tool that makes hosting, deploying, scheduling, and authenticating easy, but is first-and-foremost a programming tool.
We added `console.email` to the runtime to make it incredibly easy to email yourself. We don't have npm imports yet, but we do have a low-friction system that treats every user as a namespace, so you can refer to `@me.foo + 1` or `@yourFriend.bar()` right in your code. There are a lot of thorny implications this newfangled import scheme creates, but also many joyous and carefree coding experiences! One of my favorite features is that we store every evaluation, up and down the callstack, including inputs, outputs, logs, etc, which has been an amazing aid to debugging.
So far, Val Town is mostly used for what we're calling "programmatic notifications": query a data source for new items on an interval and email them to yourself.
Get notified when users you "follow" post on Hacker News: https://www.val.town/stevekrouse.hnFollowPollJob
Get notified when to close your window during fire season in SF: https://www.val.town/stevekrouse.aqi
Get notified when there are new citations on a paper: https://www.val.town/ernest.newCitationNotification
Subscribe to RSS feeds: https://www.val.town/stevekrouse.pollRSSFeeds
A good place to get started would be forking one of those vals and modifying it to suit your needs. Some folks are using the tool in other ways, such as in webhook contexts, and we encourage those uses as well. We'd LOVE to pair-program with anyone looking to try out the tool and give feedback. Email steve@val.town :-)
Main site: https://val.town Docs: https://val-town.notion.site/Val-Town-Docs-01c8eb9c534b48998... Discord: https://discord.gg/dHv45uN5RY Blog & Newsletter: https://val-town.notion.site/Blog-6d3ef714d0c849e9be71b3986a...
[1] - Whole Code Catalog: https://futureofcoding.org/catalog/
I went ahead and dropped in a string tokenizer that I've been working on, and it worked straight away! (link: https://www.val.town/embed/catapart.magnitTokenize) I'm sure I'm doing it inefficiently, but it's pretty sweet that it just plain worked!
Thanks for building such an open platform! I know I can get some real value of utilities like this, so it's nice to know that there are folks out there willing to provide them! Hopefully any code I can add can be of use to someone!
edited to add: I also included a test of the tokenizer, if anyone was wanting to tokenize some strings with it: https://www.val.town/embed/catapart.testTokenizer
A few things:
- Add support for user secrets.
- Work on pricing ASAP. You’ve built something dope. You can be paid for it. In fact, I prefer to pay, because it makes it easier for me to feel that the product won’t just disappear after I begin to use it and rely on it. I also just like knowing folks are compensated for the work they do.
- Due to the type of product this is, security should be the #1 priority here. I understand you’re in the early stages, but please make this a focus. V8 has pretty decent isolation, but honestly, for a product like this, WebAssembly is your friend — it was quite literally designed for this type of product. A side benefit of relying on WebAssembly is that you’ll be able to support as many languages/environments as you can get to compile.
Once again, dope work!
They're under your username, in the link labeled Secrets. One can see them in use in the author's hackerNewsSearch which consumes an algolia key, and probably a bunch of others since there's a Twitter API example, too
The big thing that WebAssembly allows you to do security-wise is to execute multiple untrusted programs securely in the same address space.
This is a new capability for some languages, but JS has supported it since day one. The most popular WebAssembly runtimes are already the JS runtimes – Cloudflare uses V8 isolates to run their edge workers, for example.
You could use a lighter weight and purpose built runtime for WebAssembly like wasmtime, but the immediate benefits of doing that are unclear to me
As someone else noted, we already have secrets on the platform, but I am eager to hear more about what you'd like to pay for it and what you'd expect to get in exchange. We are all ears on suggestions :)
Hit me up if you would like help setting this up for yourself and don't want to join the Discord or something. My email is in my profile. You basically need to create a new Val for yourself called `hackerNewsAuthors` that's just an array of HN username strings.
We even posted it to HN but dang rightly rerouted us to this proper Show HN: https://news.ycombinator.com/item?id=33533830
In the meantime, we launched "Scheduled Val" which let you schedule a val with a single click, and it somewhat made hnfollow.com unnecessary because most of that tool helped you manage setting up an interval, tracking its ID, and cancelling it. Now you can just fork this single val to your account and the interval is synced to the val automatically: https://www.val.town/stevekrouse.hnFollowPollJob
The one extra step that akkartik alludes to is also important: you do need to define some folks to follow. How to handle-hold users through this process of forking + customizing vals is a real design challenge for us. Would love any suggestions!
Another one, as an example, check the FDA food and drug alerts for medicine you take. I guess the pharmacy should email you but who knows, it's just filtering an xml for a set of regex. I built a cheap example myself on a micro self hosted server I use for other things
Having quick and easy email behind a very simple url is great. Another usecase I use is I have a tiny http endpoint which just emails based on the url parameter (e.g. since it's only me my.server.com/email?msg=DONE_AI_training). Then I can use it to notify me when a long running job is done, using curl or the easy off the shelf requests that's in any language
Are there any other services that make it this easy? DigitalOcean functions have a UI for quick prototyping but afaik Google Cloud, Vercel, Cloudflare etc wrap similar functionality inside projects or similar idiosyncrasies which adds friction if all you're after is a function and an endpoint.
click "new val"
type `console.email("hello from valtown", "valtown");` , see email in about 10 seconds, and the val link has a log of emails sent
new val, `export hackerNewsAuthors = ["stevekrouse", "dustingetz"];`
go here, click fork https://www.val.town/stevekrouse.hnFollowPollJob
run
i think the hook is running now, wait for steve to post again to see?
if someone is feeling motivated, maybe integrate a weather API and mail it every morning?
It's very specifically javascript so it seems odd to name it as if it's something broader.
(Or does "cloud scripting" already have a specific association with js that has somehow passed me by?)
EDIT - I guess "Typescript/Javascript Cloud Scripting Site" is a bit of a mouthful but still...
Generally I use followthatpage.com for getting notified of changes on a few simple pages.
However, one idea that would be a pretty good use case of your tool is to get notified of new search results for any query on OpenLibrary.org .
For example, if I wanted to be notified if there are any new books added to OpenLibrary that mention "hackerNews" I could use this search https://openlibrary.org/search/inside?q=hackernews with this api call https://openlibrary.org/search/inside.json?q=hackernews
I probably won't build this now but if someone does please let me know.
I like your https://www.val.town/ernest.newCitationNotification but it works because the JSON returned by the API call happens to include a list of citations by date, rather than just returning a citation count.
If you had an API that just returned a count, how would I check to see if the count had increased since the last call?
For the air quality example, https://www.val.town/stevekrouse.aqi, what prevents the script from emailing you once per hour? During a file season that would be annoying.
You are totally right about the fire season script getting annoying. We should probably also have some mutable state there so that it only notifies you once when it goes above the threshold and then once when it's back safe again.
That is elegant. I like it.
> only notifies you once when it goes above the threshold and then once when it's back safe again.
It might also be a good idea to add an argument to the email function to tell it not send an identical email to the previous email sent within a window (or ever). So just fire off your citation count email, knowing that you will only actually be send an email when count changes.
This simplifies the scripts, while offloading a bit more work and persistance to the API.
I gotta say hosting someone else's code seems very ballsy. Building a service like this is something I've considered before but always wonder, how do you make sure they're not doing unscrupulous activities?
Excellent question. We're using a node sandboxing environment that nobody has been able to break out of yet, but we plan to move to a more secure isolation model very soon.
We're still small enough that we can keep decent tabs on what folks are doing with the platform, but it's only a matter of time before the DDOSers and crypto miners come looking for trouble...
I've been using Google Apps Script[1] for similar use cases but the limited feature set has been frustrating. Glad to see something more modern come up!
I wonder if HTML parsing is possible since there isn't npm support to import a parser yet. Maybe by dropping the parser as a separate val?
A specific example is one I made "@demo.newPaste", which seemed to fail to write to "exported @demo.pastes" until I also exported "@demo.newPaste". Is this maybe a mistake by me, a bug, or intended behavior?
I noticed that `@demo.pastes` has 41 versions. This is because every time your write to `@demo.paste` (as you do in `@demo.newPaste`), we create a new version of `@demo.paste`. You can click on the version number next to the val's name to view past versions. It seems that versions 19 through 41 are exported and the rest are private. (Vals are public or private but val versions are. Val versions are immutable, so you can only delete past versions or create new ones.)
You should be able to write to any val in your namespace from any val in your namespace, regardless of whether either are exported or not. Exported status only is relevant when it comes to using others' vals or others using yours. Let me know if you can create a repro of a bug where this isn't the case.
I'd also be happy to help on email or pair program sometime: steve@val.town :)
Echoing others in this thread who say we'd love to pay for it. I think introducing private Vals may go against what you're going for, but I hope you find a good monetization strategy!
I'm excited to see what people build here.
Do you plan to allow for self-hosting? eg. An org that wants to have a private version of this, or even internal version of it.
https://autocode.com/ https://pipedream.com/ https://modal.com https://telefunc.com/ ?
I'm a big fan of pipedream, admirer of modal, and have played around with autocode. Telefunc is new to me; thanks for the pointer; it looks neat!
We're trying to be more lightweight and intuitive than autocode, more consumer-y and code-first than pipedream, less about ML than modal, and more browser-based than telefunc.
We see Val Town as the missing web/cloud programming environment. We want running code to be as easy as tweeting. Hopefully we'll get better at explaining our unique value prop over time. In the meanwhile here's the closest thing to a mission statement that we have: https://val-town.notion.site/End-programmer-Programming-a749...
Val Town is more light, fun and social. It's meant to be used in personal and casual use-cases -- at least for now. We want to give off more GitHub vibes; less AWS vibes.
Eventually, we'll offer paid services for folks that want more processing power or other goodies, but we will always provide a generous free tier.
Our database on Supabase is $75 / month, and it's also way overkill but the dollars are small and we'd rather be safe.
So yesterday we were just under $100 / month, but today we're closer to $150.