5 ms·
One thing modern languages don't do is compiling to multiple targets intended to work together. For example, you could have a single function include frontend,
by Kinrany 5y ago
One thing modern languages don't do is compiling to multiple targets intended to work together.
For example, you could have a single function include frontend, backend and database logic. The source code would be compiled into three pieces of software: a web page, a web service and a database plugin.
- geodel 5y agoHuh, what does that mean? I can have Go text/html templates, normal business logic/ service and code to talk LDAP/RDBMS backend in single app / source file. I can not just compile but run this whole thing including web server as one single process.
- Kinrany 5y agoI'm talking about a single function being compiled into three separate processes. fn onclick(ui, db, worker) { ui! { spinner = true }; let value = db! { value = value + 1; value }; worker! { notify(value) }; ui! { spinner = false; value = true; }; }
- geodel 5y agoAnd now these 3 separate processes are deployable without any dependency other than OS?
- Kinrany 5y agoAaand here it is: https://news.ycombinator.com/item?id=29034188 https://news.ycombinator.com/item?id=29034188 Haven't read the details yet and I don't think it's the exact same thing, but close enough.
- deleted 5y ago[deleted]
- Kinrany 5y agoTheir lists of dependencies fully depend on the code, of course, it doesn't need to be magically agnostic of everything. But using something not available for a specific target should be a compilation error. And there needs to be a build system that wraps the compiled outputs into deployables. It's not the compiler's job to know how to deploy the code, it only needs to know the target architectures that can be deployed. (I'm not sure I fully understand the question.)