Live data from Hacker News

Vapor: a type-safe web framework for Swift

github.com

51–60 of 76 posts

Re: Vapor: a type-safe web framework for Swift

#51
post #47
post #41

Earlier quoted context omitted.

I also really have great hopes for Swift as a modern, x-platform, general purpose, compiled language. Go is not general purpose; Rust is too low level. Haskell has a too steep learning curve. Ur/Web is really great, but not at all general purpose. Why am I hung up over "general purposeness"? Well when I learn a language, it takes quite a bit of my time; then I want to be able to apply it broadly. Therefor I shun Node…

> Go is not general purpose Can you explain?

There is no arguing with Turing equivalence of Go and most other languages but there are practical limitations which prevent more complete general purposeness.

I like Go since the beginning. However, Go cannot be easily used for kernel development, soft or hard real-time or embedded systems (no linker script support and porting runtime is weighty) and there are few transpilers.

Rust is slightly better, because PoC kernels have been put together with fewer hacks. Haskell, C, Ada, assembly are much more general purpose in terms of being able to build something like seL4, an F-15 cockpit, an engine management system or compiling code as ASIC circuitry. (Perl's supposed use in nuclear armaments notwithstanding.)

PS: I would like to see some geninuses come up with a back-back-end to LLVM or a disassembler which could formally prove binary satisfiability of program correctness without mind-bending, gibberish, over-mathematized, incantations inaccessible to us mere, stupid mortals.

Re: Vapor: a type-safe web framework for Swift

#52
post #48
post #41

Earlier quoted context omitted.

I also really have great hopes for Swift as a modern, x-platform, general purpose, compiled language. Go is not general purpose; Rust is too low level. Haskell has a too steep learning curve. Ur/Web is really great, but not at all general purpose. Why am I hung up over "general purposeness"? Well when I learn a language, it takes quite a bit of my time; then I want to be able to apply it broadly. Therefor I shun Node…

How is Go not general purpose?

Try to build a mobile app with Go.

Re: Vapor: a type-safe web framework for Swift

#53
post #25

But why? Why would you create a web framework in a single-thread environment? This line of code: https://github.com/tannernelson/vapor/blob/master/Sources/Se... - makes this framework totally useless.

Because it would be nice to run a web server on my phone? I'd love to have something like sandstorm in my pocket.

Re: Vapor: a type-safe web framework for Swift

#54

How is this "insanely fast"? Running an example main with the route '/' mapped to return "Hello World" ab -n 10000 http://127.0.0.1:8080/ I get 1400 requests/s in debug mode and 1900 requests/s in release mode. With wrk, I actually get between 3000-4000 requests/s with default parameters. Most of the time. Sometimes it just hangs. Trying to increase the number of requests with the -r parameter made the hangs consiste…

"insanely" fast was meant as a comparison to languages like PHP and means both performance and time it takes to set up.

Re: Vapor: a type-safe web framework for Swift

#55

It's weird how little qualifies for 'type-safe' nowadays. The templating language is not typesafe for example. The parameters in the request aren't either. Take a look at http://haskell-servant.github.io/ if you want to see what type-safe means.

We are working hard to make all aspects of Vapor totally type safe. But, just by merit of being Swift, it's already infinitely more type safe than something like PHP.

A key goal of the project is to avoid the use of `Any` anywhere possible, and to move any run time safety checks to compile time.

Re: Vapor: a type-safe web framework for Swift

#56
post #25

But why? Why would you create a web framework in a single-thread environment? This line of code: https://github.com/tannernelson/vapor/blob/master/Sources/Se... - makes this framework totally useless.

This line is just meant to keep the process alive. The actual implementation of the ServerDriver uses threads. It's also worth mentioning that Vapor is totally protocol-based and modular, so you can easily plug in any class that conforms to ServerDriver and replace this logic.

Re: Vapor: a type-safe web framework for Swift

#57

Is there documentation I'm missing? Based just on the readme I don't think I understand how this works. For instance, the section on the Request object omits HTTP headers, then the Async section shows sending response headers manually. But they're sent asynchronously for some reason? There's a .Hash method that apparently does SHA-1 hashing, though I don't know why. At the point I stopped reading because I didn't und…

There is additional documentation in the Wiki.

Re: Vapor: a type-safe web framework for Swift

#58

It's weird how little qualifies for 'type-safe' nowadays. The templating language is not typesafe for example. The parameters in the request aren't either. Take a look at http://haskell-servant.github.io/ if you want to see what type-safe means.

We are working hard to make all aspects of Vapor totally type safe. But, just by merit of being Swift, it's already infinitely more type safe than something like PHP. A key goal of the project is to avoid the use of `Any` anywhere possible, and to move any run time safety checks to compile time.

Almost anything is better than PHP, that doesn't make this particular framework standout among many tens of others.

In any case, I'm not going to consider using any framework that isn't on the first half of this list

https://www.techempower.com/benchmarks/#section=data-r11&hw=...

Many of them are for JVM, but one cool thing about JVM, is that you don't have to use Java (Kotlin is often compared to Swift for example) while still using frameworks written in Java, like Undertow or Rapidoid.

Re: Vapor: a type-safe web framework for Swift

#59
post #47

Earlier quoted context omitted.

> Go is not general purpose Can you explain?

There is no arguing with Turing equivalence of Go and most other languages but there are practical limitations which prevent more complete general purposeness. I like Go since the beginning. However, Go cannot be easily used for kernel development, soft or hard real-time or embedded systems (no linker script support and porting runtime is weighty) and there are few transpilers. Rust is slightly better, because PoC ke…

Which language doesn't have "practical limitations"? And it's no doubt more "general purpose" than assembly. How much webdev are you going to do with assembly?

Re: Vapor: a type-safe web framework for Swift

#60
post #25

But why? Why would you create a web framework in a single-thread environment? This line of code: https://github.com/tannernelson/vapor/blob/master/Sources/Se... - makes this framework totally useless.

Because it would be nice to run a web server on my phone? I'd love to have something like sandstorm in my pocket.

You can already do that.
Post reply on HN