I'd rather choose Google's approach. Closure Templates is a language neutral templating that can be rendered both on client and server side.
As WebAssembly is essentially a lower-level optimised systems language for the web, it makes sense for Swift to support compilation to the instruction set.
This is also more analogous to Closure Templates: Swift could support the DOM, allowing it to support performant coding of templating languages for server-side Swift that would compile down to client-side WebAssembly, enabling a naturally isomorphic engine for web developers in Swift.
While I'd like to see that as well (a wasm toolchain, clang already supports it as a target), I really do not think that this belongs into this particular effort. Nothing to do with server, all to do with client ;-)
I suggest splitting webasm support into another thread
Front-End experts prefer the dead simple approach: always write client-side code in JS. In larger projects involving more developers and 3rd party JS libs it could become a nightmare if some parts are written in like TypeScript or transpiled from Java and those parts needs to adopt some other libs.
But I welcome a templating solution like Closure Templates that is easy to adopt by web developers and can be rendered both on server side (full page render) and client side (partials).
Agreed. This is a subject in its own, and as @Helge_Hess1 pointed out, it's predominantly client-side, not server-side. The WASM compilation is during build, and not (like some isomorphic frameworks) at run-time.
And since when does a language wait for penetration before adopting a concept? No one's stopping front-end developers using Closure, TypeScript, CoffeeScript, etc. These are unrelated. However, isomorphic approaches to web development are becoming more prevalent due to the more singular skillset necessary and ability to combine two tiers with a common code-base. Current isomorphic approaches depend on NodeJS predominately.
The ideas behind Rust supporting WASM is to enable Rust to be a more obvious language for server-side and, inherently, web development.
If this conversation is to continue, let's move it to a new thread separately from the server group. FYI: this subject has been raised multiple times already, and I believe it's very relevant and timely to discuss it now. Just not here.
I don't know a lot about how NIO is designed but I want to highlight two things:
- For me, server-side does not only include Web Services but also data-processing, crawlers and many more server processes. A lot of them, should not require NIO nor its async design.
- At least the Database Drivers and Storage Clients packages would be extremely useful in a lot of different environments apart from Web Services. ETL processes, client applications and even Swift for TensorFlow code could benefit a lot from having a common Swift SQL/Database access layer.
Thus, it would be great if this common database access layer could be useful for both worlds.
We've recently discussed internally about the option of switching an eco system. Swift is obviously one of the candidates. We've composed a list of stuff that are of interest regarding our use case.
I'd like to share the list here.
How we should go forward in stabilising and improving our execution.
- Good typing system
- Python interoperability / (Protobuf | Avro | Thrift) interoperability
- Something like this https://github.com/apple/swift-protobuf
- MongoDB support
- Good way for working Mongo and GCP eco system (ORM / ODM / Active Record & co..)
- Concurrency and easy async-await-ish programming.
- Web Framework:
- with user input type casting
- with function like (req) ⇒ res
- Good practices enforced by tooling and automation
- REPL and IDE >> Fast Iterations (as possible)
- Package Management
- Eco System
fucking greatunit test frameworks
- Hopefully something like Jest
- Good CLI framework
- If no perfect primitives for everything at least easy meta programming
- Intuitive readable syntax
Works with VSCode
I'm not sure if that library will play nicely with asynchronous database drivers, but yeah that is the type of library i was thinking of.
I'm sure the SwiftNIO team would welcome new codecs and protocols being implemented - NATS sounds like a very useful addition.
That's great to hear. There is a logging thread underway - it would be great if you could share your logging API and discuss its design there.
Are these already open-source? Can you provide a link to them?
Forgive me - what's DAT?
I take your points, but want to highlight that SwiftNIO is not limited to Web Services - it is a low-level async networking framework. You could, for example, use SwiftNIO to write a DNS server, or an AMQP broker, or an SMTP client, or......
I'll take a look.
Some are. The mirrors on GitHub for others are 3 to 5 months old – waiting for the latest milestone pushes, but they can be done quickly enough. I'm just tidying up the documentation to match the code.
Same projects as we discussed by email, but the milestones slipped, twice. I'll be demoing them all next month & I'll share a URL with them all on next week with the new docs and links to GitHub.
DAT is a decentralized hypermedia protocol for web sites. I'm currently supporting both HTTP (via Kitura) and DAT on all projects, with DAT being in an experimental branch.
It's one of several emerging protocols for building decentralized web applications.
Absolutely, the more protocol implementations with SwiftNIO the merrier. If you do get stuck anywhere or hit any NIO bugs, please do let us know we're happy to help .
Great: I'll take a look at how SwiftNIO can be applied to the codebase this weekend.
I need to take a closer look at this. Anyway agreed, let's move this to a separate topic.
Adding more to the Wishlist feedback
Under Develop Experience category:
- Standard way to log, capture, and reply requests in production or developer machine.
- Lightweight remote debugging
- Ability to debug by deploying source code (think python who's source code can be vim'ed via ssh)
- Compile source code into binary (think java that includes source code in jar's for ex.)
- Standard schema evolutions for API's (Take Avro for ex.)
- Ability to deploy services while the system is running (Think Erlang)
More on scheme evolution, and big data. The ultimate solution would be a columnar storage format, that carries schema within, that can be represented in both on disk and as response from an API call. The would support complex types, compression and have an optional schema.
Avro comes the closet (but not perfectly) https://databaseline.bitbucket.io/an-overview-of-file-and-serialization-formats-in-hadoop/
Also should the format allow 0 memory copying operations such as https://google.github.io/flatbuffers/ or https://arrow.apache.org that would truly be the holy grail of data serialisation and IPC formats.
+ 1 for hot code reloading. Don't know if it's possible, but that would be phenomenal given that development cycle speed is a pain point for compiled languages
Another point of interest along the same lines would be something like Ruby's Rails Console https://pragmaticstudio.com/tutorials/rails-console-shortcuts-tips-tricks
For those who are unfamiliar, it gives the user access to variables and methods within a running server along with a few other features, so you can do things like test methods, run synchronous ORM queries, and hit routes and receive results. For example:
>> movie = Movie.first // retrieve the first entry in the Movie table >> movie.title // access fields => "Iron Man" >> movie.rating => "PG-13" >> movie.director => "Jon Favreau"
I've begun looking at implementing swift clients for services like Zookeeper and Kafka, and implementing codecs such as Avro. These are really just beginning to germinate at the moment while I concentrate mostly on swift-nio-http2, but my overall aim is to make it easy for services written in Swift to talk to other members of the data center and coordinate properly.
Right now I've got to the point where I've modified the Jute compiler in Zookeeper to spit out Swift implementations of the generated types, and I'm wondering whether that's something work exploring on its own. It's officially part of the Hadoop pipeline I believe, so whether it's worth looking there for a starting point that would then make it easier to build Swift into other Apache projects.
Rails dev here!
To be more precise,
rails console doesn't give you access to the running rails server. Rather, it gives you a REPL with some packages (gems, like ActiveRecord) imported automatically, plus a database connection, a logger, etc. Basically it bootstraps everything the server would need, but instead yields to the REPL.
I believe most of this could be accomplished by simply importing your application module and running a bootstrap function, which would no doubt depend on the framework you were using (or not using).