Server work group, new focus areas


#41

+ 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"

(Jim Dovey) #42

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.


(Michael Bates) #43

Rails dev here! :wave:

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).

Swift already has a great REPL, but as far as I can remember, getting access to SPM packages from the REPL is still pretty tedious. I think it would be a huge boon for SPM to provide some conveniences around that. (This may have changed since I looked at it last) Furthermore, being able to start a REPL with a function call would :+1::+1: (à la the Python debugger, Javascript's debugger, etc.)


(Ankit Aggarwal) #44

This is not done yet (SR-1573). It would be great if someone from the community wants to work on implementing this.


#45

Thanks for clarifying :) I've got very limited rails experience so it's good to have someone else to fill in the gaps


(Michael Bates) #46

That's great! Yes, I agree. Especially since it's a two year old ticket :broken_heart:
I'll see what I can do about that.


(Maxim Veksler) #47

I want to add another thing that would be good to have, and having it in Swift #first would be setting a good path.

w3c has recently profiled the concept of Server Timing, i.e. standardised way by which server can report request timing to the client. You can think of it as a low level APM approach.

Here is the spec https://www.w3.org/TR/server-timing/

And here is an example of how it might look:

EXAMPLE 1
> GET /resource HTTP/1.1
> Host: example.com

< HTTP/1.1 200 OK
< Server-Timing: miss, db;dur=53, app;dur=47.2
< Server-Timing: customView, dc;desc=atl
< Server-Timing: cache;desc="Cache Read";dur=23.2
< Trailer: Server-Timing
< (... snip response body ...)
< Server-Timing: total;dur=123.4