Live data from Hacker News

Choosing a Web Framework/Language Combo for the Next Decade

jacquesmattheij.com

201–210 of 228 posts

Re: Choosing a Web Framework/Language Combo for the Next Decade

#201
post #128

Earlier quoted context omitted.

Living in Romania right now, but I'll ping you when I'm back in NL (I go there at least once every few weeks), Clojure seems to be the most approachable from the languages you list. Besides your listed reasons mutable state is becoming a bigger and bigger bottle neck as the number of cores goes up and that's why functional programming is becoming more and more important. It also makes programs much harder to write in…

This may be my biases speaking but I'd say Scala is a more approachable option than Clojure (and more popular, and has a first-class web framework in Play). It keeps more of the traditional OO style and syntax - you can use scalaz and write scala that looks like Haskell, but you can also write code that corresponds line-by-line to java, whereas with Clojure you're forced to make a more immediate leap to the lisp-styl…

That's a major appeal of Clojure, the Lisp (not Lisp-style) syntax, the functional paradigm (and the idioms are great). I really don't want to write code that corresponds line-by-line to Java. If I wanted to do that, I'd just write Java. However, Java interop with Clojure is straightforward. Furthermore, Clojure allows one to solve problems with an "orientation" toward objects, but as one learns to write Clojure well, the language guides one toward sublime and elegant functional solutions. An important thing about Clojure, however, is that it is not tied to the JVM; The original and most well-known implementation is for the JVM, but not only is there also Clojurescript, there are implementations that compile to CLR bytecode, Python, Ruby, and Actionscript. And with EDN, the extensible data notation, not only can you have your front-end and back-end codebases entirely in Clojure, you can transfer and store your data as Clojure too. I know not everyone has the same aesthetic tastes as I do, but I do like to think that there is something beautiful about this.

Finally, I must say that while Scala does indeed have a first-class web framework in Play, web frameworks are first-class objects in Clojure. Joke. Sort of. I personally do not want to have a monolithic pre-packaged web framework to bow down to; the Clojure community is a community of hackers, we like to make things out of other things, and to take things apart. Clojure and the work of its community allows me to compose my own web framework as needed very very quickly–and to drastically change it just as fast. I'm not saying you should stop doing what you like to do, but if you gave Clojure a chance...dude: it's addictive.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#202
post #197

Earlier quoted context omitted.

There is not really any operator overloading going on. You can implement Monoid for your data structure, but as long as you follow the laws... well, you are implementing operations in the correct way, there is no abuse there, nothing that's surprising and going to bite whoever is reading your code. But one thing where Haskell errs, in my opinion, is in allowing arbitrary infix operators with random ASCII characters,…

And so with Scala (user-defined operators) and Clojure (macros).

Yeah, have you seen what the Scalaz guys are doing? The operators aren't even ASCII! Apparently, there's something about monads that absolutely requires weird symbols.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#203
post #187

Earlier quoted context omitted.

Do you have a few concrete examples, out of curiosity?

Well, I basically went "fuck this" after looking at Haskell for a while, but there's surfaced some links in the comments (thanks, akavel) and they provide some examples: >>=, >>, >, , >, $, ., !!, !, , :, ::, \, @, ~, - , -> Taken together the syntax makes no effort whatsoever to be self-explanatory. I could handle it if it was the only programming language I would ever use, but in the polyglot world we live in and w…

I see what you mean. Most of these are custom operators which happen to be in the stdlib, but I wouldn't say :: or ->, for instance, should feel particularly mysterious with a bit of practice.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#204
post #17

I (naturally) think that the article's summarily dismissing Haskell is unfortunate. It's probably just the result of poor PR on Haskell's part. Haskell is not only for surpassingly intelligent people, or even optimized for them. If anything, it's the opposite: one of its core tenants is that we're not smart enough to reason about our programs in most languages. Much of the design work focuses on unloading complexity…

I love Haskell because I don't have to depend on my working memory. It's so nice to have the compiler tell me everywhere some type I've changed is used, or places I've forgotten to consider possible values.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#205
post #128

Earlier quoted context omitted.

This may be my biases speaking but I'd say Scala is a more approachable option than Clojure (and more popular, and has a first-class web framework in Play). It keeps more of the traditional OO style and syntax - you can use scalaz and write scala that looks like Haskell, but you can also write code that corresponds line-by-line to java, whereas with Clojure you're forced to make a more immediate leap to the lisp-styl…

That's a major appeal of Clojure, the Lisp (not Lisp-style) syntax, the functional paradigm (and the idioms are great). I really don't want to write code that corresponds line-by-line to Java. If I wanted to do that, I'd just write Java. However, Java interop with Clojure is straightforward. Furthermore, Clojure allows one to solve problems with an "orientation" toward objects, but as one learns to write Clojure well…

> I really don't want to write code that corresponds line-by-line to Java. If I wanted to do that, I'd just write Java.

The code I write now is nothing like Java, but it's a question of how you get from there to here. When I started Scala I wrote what I'd write in Java. In the first week I removed the semicolons. In the second week I started to use function literals. Then I started using match/case. Later I found out about for/yield with futures. And so on. I learnt the language at my job, and I was delivering real, user-facing features in it from day 1. I don't think I could've done the same with Clojure.

(Reasonable people can disagree on syntax; I find that Scala's lets you get very close to the language of the domain (e.g. see the Spray "routing DSL") and that's worth the cost it imposes on the macro system)

Re: Choosing a Web Framework/Language Combo for the Next Decade

#206

Earlier quoted context omitted.

Your decision process isn't the same one I would have gone through* but it's rational. I was responding to the conclusion that "nothing out there is very good". * I believe that the incidental complexity in web development is rooted in state and in the interactions between various pieces of state in the app. Choosing tools and patterns that reduce state generally results in composable abstractions and more reliable s…

Do you use Om with React? If so, do you have an opinon on it vs. Backbone, Angular, etc.?

I've used Om and it works but the cljs ecosystem only really started up in December when Om came out and everybody discovered React. I don't use/recommend Clojurescript outside a Clojure shop because frontend skillset+clojure is extremely rare and you do have to do everything yourself.

If you have a Backbone app, replacing your Backbone views with React is a pretty substantial win. The Backbone app structure works best if you can just listen for a change event and run your model through template code and slap it into the DOM but that gets complicated if you want to nest views, the DOM you're replacing has state, or you have something like jQuery UI widgets. All these issues simply go away if your view code is React and everything just works. I don't find the Backbone abstractions too useful so I've only done this personally when consulting and wanting to make the minimal set of changes to the codebase.

I was using Angular for two years before I switched over to React. React basically replaces directives and for that use it's simpler, composes just as well, and scales better for both data size and dom node count. Replace the Angular DI stuff with browserify/webpack and Jest and there's not that much left. The main reason to use Angular would be if you want to take advantage of the Angular ecosystem or if you plan on focusing mainly on directives to support a bunch of designers since non-directive Angular is super simple.

For other stuff, the main benefit in a two way databinding framework (or virtual DOM diffing) is that you can isolate your business logic from the DOM. That's the major win and everything else is pretty much taste. The React approach results in the least amount of state in my code by a fairly significant margin so I consider it the best but having different preferences is completely reasonable.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#207
post #161

Grails is written in Java. And while Grails today is a great servlet framework, Grails 3.0 will allow new application profiles, like netty, hadoop and batch.

So it says in the over 1 year old rant on Grails 3.0 http://grails.io/post/48599814766/more-on-where-next-for-gra... but it's very slow coming. Same with other Groovy ecosystem software like Groovy which hasn't made a dent in it's new MOP, Antlr grammar, or Java 8 lambda retrofit. And Gradle which still ships with Groovy 1.x.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#208

Interesting views on Python - I decided to start using it for personal projects after trying Go for a bit. Initially I hated the significant whitespace, and indeed many other things, but I stuck with it and I find it all rather elegant - I certainly haven't noticed any huge problems with dependencies but I've probably stuck with pretty mainstream ones (e.g. Requests). I now rather like significant whitespace and ofte…

>my ideal language would probably be half way between Python and Lisp

You might like F# then. It's concise like Python and has all the power of functional programming.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#209

Earlier quoted context omitted.

Persistent structures are almost always O log N (because they have to be trees). You can fix your branch out for better performance at the cost of more wasted space. You will never be as fast as an array. Also, sometimes you want your updates to a data structure to be seen via an alias (happens often actually), then we are back at square one again. Systems people are much more pragmatic about this: they see the trend…

At n=32 the performance costs are as negligible as dynamic typing once was (even less I'd argue.) As far as I can tell that very much puts us at the point in time where mutable state is usually a premature optimization. Adopting it successfully does require separating essential from accidental state which naturally leads to some variant of FRP being adopted to manage (re-)derivation of accidental state; which is usua…

n=32 leads can lead to lots of sparseness, memory pressure, bad locality (given sparseness); its not going to fly easily as the default. The shared memory aspect is even a bigger hurdle: people share memory for a reason, its not very often accidental. FRP is hardly the answer, but I work on a competing paradigm so mark me as biased.

The systems people I work with do a lot of key value stores (sharded NoSQL-style databases), there is a lot of pipelining for data parallel processing (MapReduce, Pig), and there is still a lot of classic locking going on, throughput is important. Oh, and lots of Paxos, logging, state replication, etc... The normal stuff you could find at Google (note I don't work for Google).

On the HPC side, the people that really care about performance, there is some map reduce via MPI, but most of the big gains are to be had in CUDA, which is an extremely imperative programming model with very synchronized core executions and memory accesses.

I've learned that whenever the FP people talk about high performance, they usually mean something else (like concurrency that isn't so slow), rather than the real high performance stuff that the big kids (systems and HPC communities) are doing.

Re: Choosing a Web Framework/Language Combo for the Next Decade

#210
post #54

Might as well go with the one which sparked the wave which inspired most of these. Rails is pretty much the premier MVC framework. If you are going to go MVC, go with Rails. If we are looking for an alternative to Rails, then we are probably looking for an alternative to MVC, and none of these mentioned choices fit the bill. I wonder when the day will come that we finally get sick of recreating all the libraries that…

I've used Laravel a lot and my very biased personal opinion is that it's hard to beat. Have you tried it?
Post reply on HN