News for hackers. Stuff that matters.
Re:Zerocal – A Serverless Calendar App in Rust by spdustin on Thursday October 06, 2022 @02:37PM (#33112208)
I want to make sure I understand this:

You made a VCALENDAR generator with a web-accessible endpoint. It fills in the VCALENDAR with info passed in via URL parameters. And rather than returning a webpage, it just returns the VCALENDAR file.

So you send your friends the link, they click it, rather then returning text/html content, it returns a downloadable response consisting of a pre-filled VCALENDAR file with the correct MIME type, and .ics extension.

Do I have that right?

Re:Zerocal – A Serverless Calendar App in Rust by omn1 on Thursday October 06, 2022 @02:58PM (#33112461)
That's correct.
Re:Zerocal – A Serverless Calendar App in Rust by EGreg on Thursday October 06, 2022 @04:18PM (#33113506)
Sorry but how is it serverless? Is it a static HTML file with JS that does the job? Isn't there a server that the request goes to?
Re:Zerocal – A Serverless Calendar App in Rust by omn1 on Thursday October 06, 2022 @04:25PM (#33113612)
Good question. It depends on your definition of serverless. Strictly speaking there is no serverless, there's always some infrastructure somewhere.

However the calendar file gets created out of thin air from the GET parameters alone. There is no state or storage involved. Other calendar apps have a backend with a DB; this one doesn't. Now whether that counts as truly serverless is up to you I guess. It's as close as you could get with a calendar I'd say. Not easy to get the point across in a title. ;) Hope that helps.

Re:Zerocal – A Serverless Calendar App in Rust by actuallyalys on Thursday October 06, 2022 @06:50PM (#33115153)
"Stateless" is probably clearer. "Serverless" usually refers to services from cloud providers where your code is run on demand rather than having a server that is idling around (to use a sibling comment's phrase). I don't really care for "serverless" as a term because there are still servers (as you point out) and there are other architectures and cloud services that seem equally serverless that aren't usually called that.
Re:Zerocal – A Serverless Calendar App in Rust by jethro_tell on Thursday October 06, 2022 @04:30PM (#33113676)
serverless is when you save the state but don't keep a machine sitting around when there are no requests, so you'd keep your calendar state in a hosted db and when someone asks for the calendar, a thread spins up and creates the calendar from the state and then disappears until there is another request. This is basically the exact opposite of serverless
Re:Zerocal – A Serverless Calendar App in Rust by rustyminnow on Thursday October 06, 2022 @04:56PM (#33113988)
> serverless is when you [...] don't keep a machine sitting around when there are no requests

FTFY

The key part of serverless is that you don't have a server idling around. Whether or not you use a hosted db is not relevant.

Re:Zerocal – A Serverless Calendar App in Rust by outworlder on Thursday October 06, 2022 @06:12PM (#33114778)
And you may even use some 'serverless' DB services. Or not. The app is still serverless.
Re:Zerocal – A Serverless Calendar App in Rust by drexlspivey on Thursday October 06, 2022 @04:39PM (#33113798)
This can easily run on Cloudflare workers, you don't even need a server
Re:Zerocal – A Serverless Calendar App in Rust by jcelerier on Thursday October 06, 2022 @06:11PM (#33114763)
... what do you think those are
Re:Zerocal – A Serverless Calendar App in Rust by vlovich123 on Thursday October 06, 2022 @09:16PM (#33116286)
The generous interpretation of what op said is that you don’t have to maintain a server in any way or shape which is indeed the case. You only write business logic while the infrastructure automatically connects it to handle inbound requests.
Re:Zerocal – A Serverless Calendar App in Rust by adamrezich on Thursday October 06, 2022 @06:34PM (#33114997)
this thread is making me feel like I'm going crazy
Re:Zerocal – A Serverless Calendar App in Rust by aliqot on Thursday October 06, 2022 @06:44PM (#33115078)
Mmm yes, this one reminds me of the microservices debacle from a few years ago about when does your monolith technically become a microservice. I can't find the link, but I think we were unable to clearly define at which point your monolith has become a true 'SoA' group of microservices.
Re:Zerocal – A Serverless Calendar App in Rust by Thaxll on Thursday October 06, 2022 @07:37PM (#33115587)
Your app is always running to answer those GET so it's not serverless. Serverless means that your rust code would be invoked upon GET.
Re:Zerocal – A Serverless Calendar App in Rust by rhn_mk1 on Friday October 07, 2022 @01:46AM (#33117850)
Isn't it serverless when it's local-only? Or, in an extreme case, peer-to-peer?
Re:Zerocal – A Serverless Calendar App in Rust by tuukkah on Friday October 07, 2022 @06:32AM (#33119474)
Then I missed the point and your use case. I re-read your article and this is the only sentence where I believe I could have got it if I read it carefully enough:

> Now I can finally send my friends a link to a calendar event for our next pub crawl.

I suggest you update the tagline to say "link" as there is no "terminal" involved. That is, you don't use cURL and you don't send a normal calendar invitation email, but instead you send a message with a link that gives them the ical file when they click it.

Re:Zerocal – A Serverless Calendar App in Rust by aaaaaaaaaaab on Thursday October 06, 2022 @03:38PM (#33112979)
Do you even need a service for this? Couldn't this be a simple static HTML + minimal JS that opens a base64 URL with content-type "text/x-vcalendar"?
Re:Zerocal – A Serverless Calendar App in Rust by omn1 on Thursday October 06, 2022 @04:17PM (#33113490)
Not sure I understand because that's what it is basically. The Rust part is just for the routing; it decides whether to serve the form or the generated calendar file.
Re:Zerocal – A Serverless Calendar App in Rust by resoluteteeth on Thursday October 06, 2022 @04:51PM (#33113929)
What they mean is that instead of using "serverless" hosting running a rust program to generate ics files you could literally just have a statically hosted html file that uses a couple lines of javascript to generate the ics files within the browser, so there would be no rust or server component at all.

You could just host it with github pages.

Actually I'm confused why you're saying:

> The Rust part is just for the routing

Because it appears that you're generating the ics files in rust?

Re:Zerocal – A Serverless Calendar App in Rust by omn1 on Thursday October 06, 2022 @05:44PM (#33114487)
Got it. The generator logic is in Rust yes. I could have written it in JavaScript as well but it was just easier for me to do that part in Rust. Should have mentioned that. Of course you could host a static HTML with JS on Github pages, but Github pages also runs on a server. So to answer the original question, yes you do need some server for it unless you make it a command line app.
Re:Zerocal – A Serverless Calendar App in Rust by ipaddr on Thursday October 06, 2022 @06:29PM (#33114964)
You need a browser and a file. In your example you need a server to make the file and and a browser.
Re:Zerocal – A Serverless Calendar App in Rust by omn1 on Thursday October 06, 2022 @06:38PM (#33115032)
True, but for others to resolve the calendar entries you'd need to serve that file somewhere.
Re:Zerocal – A Serverless Calendar App in Rust by stoplying1 on Friday October 07, 2022 @03:30PM (#33125851)
/me glances at serverless in the title. Man, I would not want to have to technically design anything with you. You can't just say a thing is something and then say "oh well it's not actually but it could've been if I had made it entirely differently." ...
Re:Zerocal – A Serverless Calendar App in Rust by aaaaaaaaaaab on Thursday October 06, 2022 @06:00PM (#33114652)
You can serve a static HTML page from anywhere. GitHub pages, S3, maybe even Dropbox. Running a Rust binary is an order of magnitude more complex than that.