Live data from Hacker News

A Dead-Simple Web Stack in Haskell

williamyaoh.com

41–50 of 120 posts

Re: A Dead-Simple Web Stack in Haskell

#41

Earlier quoted context omitted.

Yup. I think people forget that things aren't the way they used to be because we made forward progress. Maybe that means things got more complex. It also means more things became possible and it became possible to not have things happen which you wish didn't. If everything worked so fine and dandy in the good old days, we'd still be there.

I can respect this, and acknowledge that there are use cases for all the infrastructure. My question is, are the trade-offs being considered? Not every use case requires all the bells and whistles. It seems possible that development pipelines have moved towards using the bells and whistles in part because developers are familiar with them from FAANG use cases. People choose to use what is in use, often for good reaso…

Yeah. I agree. Sometimes the trade-offs are balanced in favor of human factors more than the technical ones and it can skew the results in favor of solutions that aren't exactly a perfect fit, but they're deemed workable because you can find warm bodies willing to work on them .

Re: A Dead-Simple Web Stack in Haskell

#42
post #36

I think a simple web stack should aspire to the simplicity of the PHP stack, twenty years ago: 1) Create a directory "foo" on your server 2) Make a file called "bar.php" in that directory 3) Write "Hello World!" in the file 4) Open http://localhost/foo/bar.php in the browser and see "Hello World!" Lines of code or configuration so far: zero . 5) Add some actual code to bar.php 6) Reload the page and see the result Nu…

That assumes you've got apache set up, or nginx and php-fpm. It also uses the php interpretor. If you had to build a binary like Haskell would, your approach would be different (although you could run haskell in interpreted mode I wouldn't recommend it). It's also kind of unfair because PHP was created for making web pages, Haskell wasn't.

I spent my high school (~2006) lunch and free periods teaching myself web development on the school computers in the library, running Portable Notepad++, Portable Firefox, and Portable XAMPP, off my third-gen iPod's hard drive. Very good times. XAMPP made LAMP on Windows beyond painless. I miss that old stack.

Re: A Dead-Simple Web Stack in Haskell

#43

I think a simple web stack should aspire to the simplicity of the PHP stack, twenty years ago: 1) Create a directory "foo" on your server 2) Make a file called "bar.php" in that directory 3) Write "Hello World!" in the file 4) Open http://localhost/foo/bar.php in the browser and see "Hello World!" Lines of code or configuration so far: zero . 5) Add some actual code to bar.php 6) Reload the page and see the result Nu…

I agree that software development has become (often) pointlessly over complicated in the past few years. For my personal projects I usually develop in Yii2, vanilla JS, SCSS, on MAMP. Source lives in Git, deploy via FTP. I track my progress on a simple kanban. I can push out really complex web applications in days. At work, currently we use headless Drupal 8 as an API layer, React/Angular frontend, automated deployme…

> They're two different approaches, one is quick and "dirty", the other is "enterprise", but the end result is the same: a website.

I would say one is appropriate for simple CRUD websites and the other is appropriate for more complicated web apps. Especially as you scale (your engineering organization or your traffic), things like microservices become increasingly useful.

Re: A Dead-Simple Web Stack in Haskell

#44
This is a great tutorial for getting up and running fast. I started off with Spock too but grew out of it pretty quickly.

It's painful in Haskell you're learning it but feel you're not able to generate anything real for the first month(s) with it. Unfortunately, there's not many up-to-date tutorials like these available for beginners.

Re: A Dead-Simple Web Stack in Haskell

#45

Earlier quoted context omitted.

> If everything worked so fine and dandy in the good old days, we'd still be there. I'm not a historian, but I'm pretty sure a historian could find a lot of counter examples to statements like this. That includes historians who know an aweful lot about programming languages.

Oh yeah. Take consumer goods got example: A straight razor or double edge safety razor and a bar of soap work an awful lot better, cost the customer significantly less, and produce far less waste than modern mass-produced shaving convenience goods at the expense of greater initial costs and a modest increase in required skillset. A fountain pen with a hand-tuned gold nib is refillable and can last nearly a lifetime w…

While its true that disposable consumer goods are a problem, I feel like you're attempting a dogpile via rhetoric rather than really engaging with the spirit of the grandparent's post.

Folks weren't even remotely concerned with industrial or consumer waste "in those days" historically, and actually produced quite a bit. What's more, many of these products you're describing used dangerous chemicals or materials that caused many problems.

And if we're really harping on writing utensils, all but the cheapest mechanical pencils easily outlast and outperform the lousy (and pointlessly expensive and historically mildly toxic) historically yellow pencils.

And for consumer electronics, its interesting to note that the non-replacement policy happens because the components are often so minimal and optimized.

It's not clear that we should apply the lessons of physical deployment to software, as the art and science of software is still developing from infancy at such an amazing pace. Modern software (even the bad stuff that us trendy to hate) tends to be remarkably better, prettier and often even faster (albeit at the cost of volatile memory) than even relatively well-thought-out older software from average developers.

Give the future a little credit, would ya?

Re: A Dead-Simple Web Stack in Haskell

#46

I think a simple web stack should aspire to the simplicity of the PHP stack, twenty years ago: 1) Create a directory "foo" on your server 2) Make a file called "bar.php" in that directory 3) Write "Hello World!" in the file 4) Open http://localhost/foo/bar.php in the browser and see "Hello World!" Lines of code or configuration so far: zero . 5) Add some actual code to bar.php 6) Reload the page and see the result Nu…

I get what you are saying and agree with the sentiment but you did omit the 10 or so steps required before your point #1.

Re: A Dead-Simple Web Stack in Haskell

#47

Earlier quoted context omitted.

I agree that software development has become (often) pointlessly over complicated in the past few years. For my personal projects I usually develop in Yii2, vanilla JS, SCSS, on MAMP. Source lives in Git, deploy via FTP. I track my progress on a simple kanban. I can push out really complex web applications in days. At work, currently we use headless Drupal 8 as an API layer, React/Angular frontend, automated deployme…

I could also edit live on my production server and the result would be the same: a website. I'm not saying that modern stacks aren't more complicated than they need, but I use a React frontend, a React-Native app, silly microservices, a non-trivial git strategy, non-trivial Trello steps, security scans, automated deployment via CircleCI and yet release multiple times a day. The biggest difference is that deployment a…

Don't get me wrong, I'm not saying the quick and dirty approach is better, I'm saying that the end product is very similar. The main difference is the surety that the code is going to work properly when you have checks in place.

Complex development processes are worth the hassle for big clients who can't have downtime, but they're not suitable for everything. I would (almost) never bother setting up such complex processes for an after hours side project site because the amount of extra work involved would ensure the project never gets completed.

Re: A Dead-Simple Web Stack in Haskell

#48

I think a simple web stack should aspire to the simplicity of the PHP stack, twenty years ago: 1) Create a directory "foo" on your server 2) Make a file called "bar.php" in that directory 3) Write "Hello World!" in the file 4) Open http://localhost/foo/bar.php in the browser and see "Hello World!" Lines of code or configuration so far: zero . 5) Add some actual code to bar.php 6) Reload the page and see the result Nu…

Did you forget the “A” in LAMP? It’s hardly zero configuration.

While Apache is certainly not zero configuration, it is pretty easy to forget about the Apache part of the LAMP stack. When I got started making websites, I downloaded "WAMP" (windows-apache-mysql-php). It took care of all the configuration and I could, as the author said, drop my code in a www folder and be off to the races.

Similarly, lots of hosting providers wouldn't expose the guts of Apache to developers. They would give you some sftp credentials, and let you upload whatever PHP files you wanted. No need to think about Apache configurations (except maybe a few htaccess files).

Re: A Dead-Simple Web Stack in Haskell

#49

I think a simple web stack should aspire to the simplicity of the PHP stack, twenty years ago: 1) Create a directory "foo" on your server 2) Make a file called "bar.php" in that directory 3) Write "Hello World!" in the file 4) Open http://localhost/foo/bar.php in the browser and see "Hello World!" Lines of code or configuration so far: zero . 5) Add some actual code to bar.php 6) Reload the page and see the result Nu…

I'm not sure this is simpler. Apache + php is probably far more lines of code. What the above is is rather all the complexity of just one rigid use-case swept under the rug.

Re: A Dead-Simple Web Stack in Haskell

#50

Earlier quoted context omitted.

> If everything worked so fine and dandy in the good old days, we'd still be there. I'm not a historian, but I'm pretty sure a historian could find a lot of counter examples to statements like this. That includes historians who know an aweful lot about programming languages.

Oh yeah. Take consumer goods got example: A straight razor or double edge safety razor and a bar of soap work an awful lot better, cost the customer significantly less, and produce far less waste than modern mass-produced shaving convenience goods at the expense of greater initial costs and a modest increase in required skillset. A fountain pen with a hand-tuned gold nib is refillable and can last nearly a lifetime w…

I think that fails Occam's razor. What if the reason there are more people "doing it wrong" (for various values of "it") is simply because there are more people doing it, period? There are a lot more programmers (and people shaving, opening cans, and writing letters) than there were in the past. As a result, the experience of doing those things changes both because of eternal September syndrome as well as the economies of scale (cheap, low quality crap) that emerged in response to that growth in userbase.
Post reply on HN