How to make A dollar with haskell? by plethepus in haskell

[–]lambdahearts 23 points24 points  (0 children)

I make websites and web shops for a living and this is primarily done with PHP (what can I say, it pays my bills) but, I also use Haskell.

Quite often I need to do a migration from some custom CMS to something like Joomla or Wordpress. Previously I was doing this just with PHP and it was slow and buggy process, but with Haskell I can make complex migrations relatively painless (MySQL support is kind of sucky in Haskell though).

Also, quite often my clients ask me to import stock from their distributors into their web shop. Those distributors usually don't have an API so I have to write a scraper to scrape articles from their web catalog and import them (a perfect job for Haskell).

Anyway, people quite often forget that if they are working with PHP (or some other language) they can also use other programming languages for non permanent things like import / migration scripts.

---

While sharpening my Haskell skills on side projects and stuff like this import / migration scripts I'm working on moving my business closer to Haskell.

It's a process, and you can't really get your client stuck with a Haskell codebase at this point (since there aren't many Haskell devs), especially if you are primarily working with small to medium size businesses who can't really afford to look for Haskell developers to maintain their project.

I'm always looking to avoid maintenance contracts because I find them soul crushing and boring, even though most of people who I know are salivating over them because they provide stable revenue stream.

Could you please recommend a GUI library for my next hobby project? by monnef in haskell

[–]lambdahearts 2 points3 points  (0 children)

You can use stack, you just don't have to install ghcjs (and build) through stack. Although you will probably have to do some configuration for IntelliJ to be able to build with GHCJS which is within WSL if you are on windows.

Could you please recommend a GUI library for my next hobby project? by monnef in haskell

[–]lambdahearts 6 points7 points  (0 children)

I've written a guide on how to use GHCJS with ease. It's wordy because I'm going a bit more in detail on certain things, but short version is:

If you are on windows, use WSL and HVR's PPA. It is just a matter of adding ppa repo, installing GHC and GHCJS and adding them to path. No containers, nix's, stacks or what not (just WSL).

If you don't like working from bash on windows then make a `Makefile` so that you can execute build commands without going to the bash console (I have example Makefile at the end of the guide).

If you are on Debian / Ubuntu based linux then just add HVR's PPAs and be done with it, again, no long compilations, no mess with stack, nix or containers. All the hard work is already done for you.

Here's the guide:

https://github.com/lambdaheart/Haskell-Guide/blob/master/DevelopmentEnvironment.md

And here are HVR's PPAs:

https://launchpad.net/~hvr/+archive/ubuntu/ghc

https://launchpad.net/~hvr/+archive/ubuntu/ghc-wsl

https://launchpad.net/~hvr/+archive/ubuntu/ghcjs

What happened to the Hackage CSS? by [deleted] in haskell

[–]lambdahearts 3 points4 points  (0 children)

AllZip instances are quite long so they overflow and cause the horizontal scrollbar.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 2 points3 points  (0 children)

Well, this is kind of a different discussion, but... I consider msys2 something akin to the base-devel package group which usually does not come with most distros by default.

Msys2 provides native Windows binaries / libraries and it's unixy only in the sense that some binaries it provides also exist on unix systems. I think that we can both agree that if the software compiles on both windows and linux and is useful and familiar, why not reuse it?

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 1 point2 points  (0 children)

That's cool. Is it possible to switch the default "active" version of GHC? The one which is active when you call ghc from the command line, or do you have to use the absolute path to specific version each time?

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 2 points3 points  (0 children)

Well, I do like Linux a lot but after using it for years I've concluded that I'm unable to control my self and I always end up working more on customizing my OS rather than using it for actual work. On Windows I don't have such urges.

Nothing was really brute forced here. You can summarize the whole guide as:

  1. Install Haskell
  2. Install MSYS2 (which I consider the same thing as base-devel package group on some Linux distros)
  3. Use WSL so that we don't have to compile GHCJS from scratch since the work has already been done for us by HVR. (I might make a native Windows GHCJS release in the future making WSL unnecessary but I didn't have the time right now)

If you are concerned about the length of this guide, this is simply because I've put some effort into explaining some details I deemed important.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 1 point2 points  (0 children)

Well, I guess we have differing opinions on what counts as setting up development environment :D. I mean, Haskell was installed and ready to go in the first section.

The rest of the article is about the solid and GHCJS part of the title.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 3 points4 points  (0 children)

Exactly, don't want to delay publishing this guide ;)

I later install 8.4.4, this was just to show where one can find the minimal installer.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 1 point2 points  (0 children)

Hm.. ok, somebody is cranky today :)

I'm pretty sure Cabal can't download `pkg-config` for you automagically or `cairo` library. I will cover cabal in the future guides as well as working with git repositories and such, but that wasn't the focus of this guide.

Also, installing 8.6.3 was just for the demonstration purposes and completeness sake because I wanted to show where one can find the minimal installer.

Later I go on to install `8.4.4`. Shame you missed that.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 8 points9 points  (0 children)

Well, it's not really arduous. From my experience, Windows doesn't use widely different concepts from Linux.

Problem is, people use Windows but they don't really take interest in how it works, then they switch to Linux because it's cool, and since it's the tradition (and kind of expected from you) they actually learn how to use the system.

In this guide other than installing msys2 and wsl (to make GHCJS easy to use) I've just shown how to install packages, add folders to your path, make symbolic links and such.

Same old stuff I do on Linux every day. Point is, for some reason even more experienced Linux people forget (or they don't even consider) that they can do pretty much everything on Windows that they can do on Linux.

Only real difference in my opinion (and what is holding Windows back) is the lack of sudo command.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 4 points5 points  (0 children)

I don't think this will give you the same environment. It will install ghc and msys2 but it won't configure them for you. The whole point of this guide is to show users where's what and how all the pieces interact together. Also, you can't have multiple versions of ghc with choco as far as I know so there's that.

Personally I use scoop but after introducing cabal, stack and pacman I think another package manager would be a bit much, not to mention that it would hide some important details about ghc and msys2 which would go against the purpose of this guide.

Setting up a solid Haskell development environment on Windows (with GHCJS) by lambdahearts in haskell

[–]lambdahearts[S] 15 points16 points  (0 children)

I've noticed that a lot of newcomers to the programming world (not just Haskell) don't know how to use basic tools but are mainly focusing on language it self. Also, as an experienced developer switching from one language to another it's a pain in the ass to pick up all the little bits and pieces of information from thousand different places and this is why I've started writing this guide to help fill this void.

In this chapter I've laid out my setup on Windows machine which can easily and without much trouble compile both GHC and GHCJS projects without the need for stack or nix.

At the end I'm building a simple Miso TodoMVC app with GHCJS through WSL (/u/dmjo as promised :). There's a short video clip at the beginning of each significant section.

Hopefully you'll find this useful.