Live data from Hacker News

Bazel can now build Haskell

tweag.io

1–10 of 54 posts

Re: Bazel can now build Haskell

#2
I wonder if Bazel takes off across many languages. It wouldn't hurt to have a modern autotools & co. replacement across ecosystems. I don't think it's doable, considering the fact that we have language specific package managers and build tools, but you never know.

By "replacement", I mean picking up a random open source project and being able to do the equivalent of:

./configure

make

make install

To be able to build and run the app directly from sources, when needed.

Right now, it's a mess, the "replacement" is:

curl whatever.io | sudo bash

Re: Bazel can now build Haskell

#4

Given that Nix is already popular in the Haskell ecosystem and it's also polyglot, why not build the monorepo with that instead of Bazel?

I am a Nix user, but one advantage that Bazel has is that it can do more fine-grained incremental rebuilding (nix as commonly used can only do per-project rebuilds). Also while there is some overlap, Nix usually relies on language-specific package managers to perform the actual building, whereas bazel handles that itself. Nix is more of a packaging tool, whereas bazel is a build tool.

Re: Bazel can now build Haskell

#5

Given that Nix is already popular in the Haskell ecosystem and it's also polyglot, why not build the monorepo with that instead of Bazel?

Can Nix build incrementally? One random collection of notes I just dug up says that it rebuilds packages from scratch on minor changes. It seems like Nix is addressing a different problem.

Re: Bazel can now build Haskell

#8

A significant hurdle for the universal adoption of Bazel is its too many dependencies.

sudo apt-get install openjdk-8-jdk

sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python

That's a fair few things, but it doesn't see that awful. None of those dependencies seem exotic. I wonder if they could get rid of Python by using Jython on top of the JDK.

Re: Bazel can now build Haskell

#9
post #2

I wonder if Bazel takes off across many languages. It wouldn't hurt to have a modern autotools & co. replacement across ecosystems. I don't think it's doable, considering the fact that we have language specific package managers and build tools, but you never know. By "replacement", I mean picking up a random open source project and being able to do the equivalent of: ./configure make make install To be able to build…

> By "replacement", I mean picking up a random open source project and being able to do the equivalent of

For that, Bazel needs someone to write all the necessary configs, and make them available out-of-the box, with sane presets baked-in.

You can look at Angular team's working on integrating Bazel into their build process, here's the repo: https://github.com/alexeagle/angular-bazel-example

There's:

- build.bazel

- Workspace

And then there are rules that have to be included and/or developed:

- nodejs rules, https://github.com/bazelbuild/rules_nodejs

- sass rules https://github.com/bazelbuild/rules_sass

- typescript rules: https://github.com/bazelbuild/rules_typescript

etc.

And those rules have to be not only loaded, but specific steps from those rules have to be invoked (see WORKSPACE).

I'd say there still still a lot of configuration involved in setting up all the moving pieces. Will it get better? Hopefully (there are just not enough good/decent build tools).

Re: Bazel can now build Haskell

#10
post #2

I wonder if Bazel takes off across many languages. It wouldn't hurt to have a modern autotools & co. replacement across ecosystems. I don't think it's doable, considering the fact that we have language specific package managers and build tools, but you never know. By "replacement", I mean picking up a random open source project and being able to do the equivalent of: ./configure make make install To be able to build…

That doesn't seem to be an issue. bazelbuild/rules_typescript is able to work with NPM and Yarn, for instance

https://github.com/bazelbuild/rules_typescript

I don't see why this wouldn't be extensible to other languages with similar build systems. In practice, I find it useful to think of Bazel as a scripting languages that works when commands generate reproducible output files.

Post reply on HN