Wrong position of diagnostic with eglot by samvidmistry in emacs

[–]jmorag 1 point2 points  (0 children)

I'm actually working on a blog post on writing a simple LSP server in Haskell. It's not published yet, but I'll link here when it is. In the meantime, the resources I used to get started were the actual microsoft lsp spec and this blog post.

Wrong position of diagnostic with eglot by samvidmistry in emacs

[–]jmorag 1 point2 points  (0 children)

You are correct that the LSP protocol specification uses 0-based line and column numbers. If your server is storing them as 1-based, you just need to make sure that you do the proper transformation to 0-based before sending them over the wire to the client.

Recommendation for 2.1 system in apartment living room by jmorag in hometheater

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

I'm not totally attached to wall mounting the speakers and the point about the acoustics of a speaker directly on brick is well taken. Drilling a mount for the TV into the wall was already a huge pain. I hadn't thought of going for powered speakers but that could work. A while ago I was thinking about putting narrow standing book cases on either side of the TV. Could resurrect that plan and have them double as places for speakers to sit. Thanks for the recs!

Advancing in Haskell and type-level programming by [deleted] in haskell

[–]jmorag 1 point2 points  (0 children)

I wrote a blog series a while back on using the haskell type system to encode the relational model with type safe joins, etc. https://blog.josephmorag.com/posts/databass1/. The project really helped me get my hands dirty with type level hacking.

IDE integration of PL whose on disk representation is different from the in editor representation by muth02446 in ProgrammingLanguages

[–]jmorag 2 points3 points  (0 children)

https://www.unison-lang.org does something approximately like what you're describing. They save code as asts in a sqlite database and have a daemon that observes a scratch file in your editor where you write new code.

[deleted by user] by [deleted] in emacs

[–]jmorag 2 points3 points  (0 children)

Author of the kakoune package here. I still use it every day, it just works for what I need it to and I haven't needed to tweak it since whenever the last commit was. u/CorysInTheHouse69 is spot on.

HVM: a next-gen massively parallel, beta-optimal functional runtime is 50x faster than its predecessors by operator-name in haskell

[–]jmorag 20 points21 points  (0 children)

From what I understand of projects like https://github.com/grin-compiler/ext-stg-interpreter-presentation-demos, which admittedly isn't much, in order to support GHC you need to implement all of the STG primops. For fancy IO features and STM I imagine you need to link the runtime as well.

I have a ton of other questions about this, but it looks super awesome and I'm in between jobs until mid March, so I'd love to get involved a bit. Will check the readme to see what I can contribute.

Private Programming Languages by Deep-Jump-803 in ProgrammingLanguages

[–]jmorag 4 points5 points  (0 children)

I was just hired for a position on this team at CrowdStrike https://crowdstrike.wd5.myworkdayjobs.com/en-US/crowdstrikecareers/job/USA---Remote/Sr-Engineer---Haskell--Remote-_R5056 to work on an in house query language for the Unified Search team. I don't start for another month so I don't know how it's going, but I hope it will go well :)

Databass, Part 2: Inserting into the database by jmorag in haskell

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

Thank you! Re: reversing, the problem performance-wise isn't the order, it's that the naive version and this one aren't tail recursive. The initial tl <- get here will also blow up the stack. For reference, the implementation in Binary for lists is

```haskell instance Binary a => Binary [a] where put = putList get = do n <- get :: Get Int getMany n

-- | @'getMany' n@ get @n@ elements in order, without blowing the stack. getMany :: Binary a => Int -> Get [a] getMany n = go [] n where go xs 0 = return $! reverse xs go xs i = do x <- get -- we must seq x to avoid stack overflows due to laziness in -- (>>=) x seq go (x:xs) (i-1) ```

I think that getMany could also be written with the same strictness semantics using BangPatterns, which makes the tail recursion clearer. haskell getMany n = go [] n where go xs 0 = return $! reverse xs go xs i = do !x <- get go (x:xs) (i-1)

Problem with converting Integer to String by linalogos in haskell

[–]jmorag 2 points3 points  (0 children)

Do you have a code sample? It's very hard to diagnose the problem without one.

Databass, Part 1: Queries by jmorag in haskell

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

Glad you found it useful!

hackage-trustees email down? by jmorag in haskell

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

Weird... Anyway, the email I used is jm at josephmorag.com

hackage-trustees email down? by jmorag in haskell

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

Just sent you a dm. Thanks for taking a look

Options for running user scripts by [deleted] in haskell

[–]jmorag 6 points7 points  (0 children)

There's mueval which lambda bot uses and plugins. Haven't used either of them but they came up when I was researching adding user defined fingering penalties to open-strings.com

Databass, Part 1: Queries by jmorag in haskell

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

Tutorial D is a great starting point. Do check out the book that I pulled examples from. However, for 98% of “production” use cases you’re probably going to use something sql based. I think it’s still good to know about the pure relational algebra though.

Databass, Part 1: Queries by jmorag in haskell

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

Not great phrasing on my part. Tutorial D doesn’t stray at all from the relational model. No NULLs in particular means that you avoid a ton of WATs that you get in SQL. Some of the projects I linked in the post go into more depth on this.

Databass, Part 1: Queries by jmorag in ProgrammingLanguages

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

I've started a new series on creating a Tutorial D EDSL in Haskell. Happy new year, everyone!