HNHacker News
TopNewBestAskShowJobs

gilmi

317 karma · joined November 21, 2015

submissionscomments
gilmi··on A decade of developing a programming language
I've mentioned this in a different comment, but I've written several articles on type inference, trying to make the topic more approachable:

https://gilmi.me/blog/tags/type%20inference

If you find that helpful, I've made more content on compilers (including live coding a compiler, without narration) which should be easily reachable from my website.

gilmi··on A decade of developing a programming language
I really enjoyed the article.

I think one way to simplify language creation is to use an existing language with somewhat similar operational semantics as a compilation target. This simplifies the backend a lot and leaves more time to explore what the language (frontend) should look like. The backend can always be rewritten at a later time. My personal choice is usually JavaScript[1].

Regarding type checkers/type inference, I've also ran into difficulties with this topic, and I've written several articles trying to make it more approachable[2].

[1]: https://gilmi.me/blog/post/2023/07/08/js-as-a-target

[2]: https://gilmi.me/blog/tags/type%20inference

gilmi··on Unity's Trap
Maybe the engine used for Dead Cells, https://heaps.io ?
gilmi··on The Meaning of Monad in MonadTrans
Monads are a bit like exiting vim. The complexity is exaggerated to the point of a meme, but in reality not very difficult, and they can be quite useful.
gilmi··on Ask HN: When is pure functional programming beneficial?
A different thing to look at is what enforcing referential transparency in your program means.

Referential transparency means that when we bind an expression to a name (e.g. `y = f x`), the two are interchangeable, and whenever we use `y` we could just as well use `f x` and vice versa, and the meaning of the code will stay the same.

Enforcing referential transparency in a programming language means that:

- We need to have more control over effects (purity)

- We can use substitution and equational reasoning

The value of referential transparency for me is that I can trust code to not surprise me with unexpected effects, I can use substitution to understand what a piece of code is doing, and I can always refactor by converting a piece of code to a new value or function because referential transparency guarantees that they are equivalent.

Because of that I feel like I can always understand how something works because I have a simple process to figure things out that doesn't require me keeping a lot of context in my head. I never feel like something is "magic" that I cannot understand. And I can easily change code to understand it better without changing its meaning.

Referential transparency is freeing, and makes me worry less when working with code!

---

The other part that is very notable about Haskell is one of its approaches to concurrency - Software Transactional Memory. Which is enabled by limiting the kind of effects we can perform in a transaction block:

https://www.oreilly.com/library/view/parallel-and-concurrent...

gilmi··on Ask HN: Could you share your personal blog here?
https://gilmi.me

31 posts. I write mostly about Haskell, compilers, webdev, and my hobby projects.

- https://gilmi.me/blog/post/2016/10/14/lisp-to-js - Compiling a lisp to JavaScript from scratch in 350 LOC

- https://gilmi.me/blog/post/2022/04/24/learn-twain-bulletin-a... - Build a bulletin board using Twain, Haskell, and friends

- https://gilmi.me/blog/post/2021/04/06/giml-type-inference - Giml's type inference engine

- https://gilmi.me/blog/post/2022/12/13/learned-from-haskell - 7 things I learned from Haskell

- https://gilmi.me/blog/post/2023/07/01/why-i-use-twain - Why I use the Twain web framework

gilmi··on MdBook – A command line tool to create books with Markdown
you welcome :)
gilmi··on MdBook – A command line tool to create books with Markdown
I've written an online book with mdbook (https://lhbg-book.link) and it was a breeze. I believe mdbook was one of the reasons I even finished the book.

1. It's super easy to install. If you have a rust toolchain, just `cargo install mdbook`

2. One command to initialize: `mdbook init my-book`

3. One command to get immediate continuous feedback: `mdbook serve`

4. It allowed me to keep writing in my preferred environment (emacs)

5. It looked good by default. I could focus on the content.

6. Setting up auto deploy ci on github is about 30 lines for yaml

Though one point of improvement would be better support for other export formats such as pdf and epub.

tl;dr mdbook allowed me to use the path of least resistence to complete my project, and I highly recommend it.

Also it is possible other platforms can do the same or better but I haven't tried them.

gilmi··on Haskell in Production: Standard Chartered
Please allow me to share a blog post and a learning resource:

- Consider Haskell - https://gilmi.me/blog/post/2020/04/28/consider-haskell

- Learn Haskell by building a blog generator - https://lhbg-book.link

gilmi··on Learn WebGPU
You might be interested in https://futhark-lang.org
gilmi··on Rust vs. Haskell
Very informative. Thanks!
gilmi··on Ask HN: Resources for Best Practice Haskell
- https://lhbg-book.link

- https://marcosampellegrini.com/simple-haskell-book

- https://leanpub.com/production-haskell

gilmi··on Why I am learning category theory
If you have 24 minutes, George Wilson's talk about propagators is really interesting and demonstrates how we can find solutions to problems by looking at math.

https://www.youtube.com/watch?v=nY1BCv3xn24

gilmi··on Ask HN: Do you recall any book or course that made a topic finally click?
CS4410 and CSE131 (they are very similar, pick one) for compilation:

- https://course.ccs.neu.edu/cs4410sp21

- https://ucsd-cse131-f19.github.io

These two articles for garbage collection:

- http://www.more-magic.net/posts/internals-gc.html

- http://journal.stuffwithstuff.com/2013/12/08/babys-first-gar...

gilmi··on Is Haskell really the language of geniuses and academia? (2019)
I agree that there are many opinions and that Haskell people don't want to compromise on what they see is the value of the language, but I've also seen a lot of people express their desire for more adoption. For example in threads talking about the haskell.org download page, in threads about improving learning resources, and with the Haskell Foundation.

This desire is usually expressed with sentiments like "let's make this easier to learn" and "Let's fix this so it's not a footgun", and not "success at all cost".

gilmi··on Is Haskell really the language of geniuses and academia? (2019)
I don't think that's correct. Especially since there's a community-led organization with the specific goal of increasing adoption https://haskell.foundation/
gilmi··on Is Haskell really the language of geniuses and academia? (2019)
- Learn Haskell by building a blog generator[0] (disclaimer: I wrote this)

- Simple Haskell Handbook[1]

- Haskell (Almost) Standard Libraries[2]

- [0]: https://lhbg-book.link

- [1]: https://marcosampellegrini.com/simple-haskell-book

- [2]: https://leanpub.com/haskell-stdlibs/

gilmi··on Is Haskell really the language of geniuses and academia? (2019)
I wrote an article of a few usecases and why I think Haskell is a good match for them:

https://gilmi.me/blog/post/2020/04/28/consider-haskell

gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
Thanks!
gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
Thank you!
gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
On the "where to go next?" appendix there's a link to my Haskell study plan[0] which has links to a bunch of extra material.

[0]: https://github.com/soupi/haskell-study-plan

gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
Sounds like a generally reasonable approach to me.
gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
Thank you. I'm glad you're enjoying it. Sorry if I sounded a bit aggressive here.

I think one of the cool things about Haskell is that there's quite a high ceiling in terms of solutions you can reach for. On many occasions when one get annoyed by something and thinks "there must be a better way", there is one.

You show how one with more knowledge and command of the language can make it do a lot of things for free, and that is very cool! But I can also see how these solutions can look a bit intimidating for people with less experience, and it's important to take this into account as well.

This is kind of a double edged sword. Gotta find the right balance.

gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
Right but the point of the book is to ease learners into the language (and teach core concepts), and not throw them into the deep end of it.

Also, I'll update the text about kinds when GHC will use Type instead of * everywhere:

$ ghci

GHCi, version 9.2.2: https://www.haskell.org/ghc/ :? for help

λ> :k (,)

(,) :: * -> * -> *

gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
No. It is built with mdbook[0].

[0]: https://rust-lang.github.io/mdBook

gilmi··on Learn Haskell by building a blog generator – a project-oriented Haskell book
When you create a project description for your project (for the package manager) you can define a library, executables and test suites.

In the test suite you write your tests against the library. You can do that at any stage, even before writing a line of library code.

But yes, Haskell also has a REPL that can be used to experiment with code.

gilmi··on Haskell error messages: come on
To further elaborate, this is the error you get on the latest GHC version (9.2.1):

  GHCi, version 9.2.1: https://www.haskell.org/ghc/  :? for help
  ghci> 1 + [2, 3]
  
  <interactive>:1:1: error:
      * No instance for (Num [Integer]) arising from a use of `it'
      * In the first argument of `print', namely `it'
        In a stmt of an interactive GHCi command: print it
gilmi··on Haskell error messages: come on
> What is my take-away here? I don’t think the compiler has been sufficiently tweaked when it comes to error messages, or that the Haskell community cares sufficiently about beginners.

I don't think it's fair to draw the conclusion that the Haskell community don't care sufficiently about beginners from this, since only selected few of the community has the ability (and time) to work on GHC and improve the state of error messages.

gilmi··on I would like a job writing Haskell
> I have never ever seen a job ad asking for Haskell.

I mean, just look at the Haskell subreddit or Haskell weekly news?

gilmi··on Haskell IHP framework, from a technical and business perspective
I've recently released a (fairly complete by still alpha version) project-oriented Haskell ebook[0].

It targets programmers that are new to the language, and focuses on the practice of writing Haskell to build projects. Specifically, a blog generator.

[0]: https://lhbg-book.link

Page 1 of 3Next →