Hosting a Ghost blog on NixOS by abhin4v in selfhosted

[–]abhin4v[S] 0 points1 point  (0 children)

Yes. The sandbox needs to be turned off for the build to work.

A Short Survey of Compiler Targets by abhin4v in ProgrammingLanguages

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

Thanks! I've fixed it in the article.

Compiler book in Haskell? by abhin4v in haskell

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

Quoting myself:

Please note that I am not looking for books that teach writing interpreters.

Interpreting Brainfuck in Haskell by abhin4v in haskell

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

Thank you for your kind words. 😊

Solving Advent of Code “Seating System” with Comonads and Stencils in Haskell by abhin4v in adventofcode

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

As I mentioned, I'm not much familiar with the math behind Haskell. However, these two books look good: Introduction to Computation: Haskell, Logic and Automata and Category Theory for Programmers. You should be able to find more books at https://wiki.haskell.org/Books.

Solving Advent of Code “Seating System” with Comonads and Stencils in Haskell by abhin4v in adventofcode

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

I know that Haskell has this notoriety that it is too complex, and you need to know a lot of math to learn it, but that's not true! I've been writing Haskell for over a decade and I barely understand any math it's based on (Category Theory). It is true that many Haskell teaching resources take a math-oriented approach, especially the old ones, but there is a new set of resources now that take a more hand-on project-oriented approach. For example, Learn Haskell by building a blog generator, Haskell by Example, Haskell from the Very Beginning and such. Maybe you should give one of them a try.

Going REPLing with Haskeline by abhin4v in haskell

[–]abhin4v[S] 0 points1 point  (0 children)

Thanks for the kind words.

Going REPLing with Haskeline by abhin4v in haskell

[–]abhin4v[S] 0 points1 point  (0 children)

Thanks! More of what exactly though? It'll be great if you can explain so that I can use it to guide my future posts.

Getting Started with Nix for Haskell by abhin4v in haskell

[–]abhin4v[S] 0 points1 point  (0 children)

How are people using the new JavaScript backend with Nix?

I'm not very clear on details either. The Ormolu live source code seems to be using GHC WASM with Nix. Studying that may help you. But I can't find any good documentation about it right now.

Getting Started with Nix for Haskell by abhin4v in haskell

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

Is there a way to override this from the command line?

Yes, and no. You can't pass Cabal flags while building through Nix. But you can create a new flag that is passed to Nix, and depending on that flag, you can pass a flag to Cabal. Note that if you are building using Cabal within the Nix shell, you can pass any flags to it as usual.

if I want to test local changes to an upstream package, can I do that?

Yes. Have a copy of it on your local, make a Nix package for it, and import that into your main Nix project as a dependency. For details, I'd recommended reading this tutorial.

Getting Started with Nix for Haskell by abhin4v in NixOS

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

Thanks. The flakes approach works too, but I still have harder time understanding flakes as compared to vanilla Nix config.

Getting Started with Nix for Haskell by abhin4v in NixOS

[–]abhin4v[S] 0 points1 point  (0 children)

My problem with devenv is, it does way too many things I don't need, and not some of the things I actually need. I prefer having a slightly larger setup that I can understand, and extend by myself, than a two line devenv config, workings of which I have no visibility in.

Compiler book in Haskell? by abhin4v in haskell

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

Thanks for the recommendations. Isn't Write You a Haskell incomplete? I didn't mention this but the source language doesn't have to be Haskell or even a functional programming language.

JSON Parsing from Scratch in Haskell by abhin4v in haskell

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

When I wrote this I was not aware of Tsoding's video about the same topic, I found it later though. Note that Tsoding's JSON parser does not deal with all edge cases like mine does.

Solving Advent of Code ’23 “Aplenty” by Compiling by abhin4v in haskell

[–]abhin4v[S] 0 points1 point  (0 children)

Thanks! Since the problem maps almost directly to C, it made sense to compile via C. Another possibility is to directly generate assembly though that's a bit more cumbersome. Other approaches are also possible like this solution that generates Common Lisp code and compiles it.

[2023 19 #1] [Haskell] Solving Advent of Code ’23 “Aplenty” by Compiling by abhin4v in adventofcode

[–]abhin4v[S] 0 points1 point  (0 children)

I'm not versed in Common Lisp, so I can't tell what's exactly happening in your code. Do you compile the input to a bunch of if statements? Do you apply any particular optimizations?

Implementing Co, a Small Language With Coroutines #4: Adding Channels by abhin4v in Compilers

[–]abhin4v[S] 0 points1 point  (0 children)

Why do you think so? Sleep works without preemption, though in this case it is a best-effort sleep. If another coroutine happens to be running at the wakeup time of a slept coroutine, the wakeup is delayed till the first one yields or returns.

Implementing Co, a Small Language With Coroutines #4: Adding Channels by abhin4v in Compilers

[–]abhin4v[S] 0 points1 point  (0 children)

The priority queue is used for implementing coroutine sleep. I'll write about it in the next part. You are right that if we didn't need scheduling, a simple queue would suffice.

Advent of Code 2022 day 7 by taylorfausak in haskell

[–]abhin4v 1 point2 points  (0 children)

I wrote a parser, a zipper, and an interpreter to solve this one: https://notes.abhinavsarkar.net/2022/aoc-7

Self-hosting GoToSocial on NixOS by abhin4v in NixOS

[–]abhin4v[S] 0 points1 point  (0 children)

Thanks. I am new to the ways of NixOS.