HNHacker News
TopNewBestAskShowJobs

montmorency88

44 karma · joined January 11, 2020

submissionscomments
montmorency88··on The hunt for the missing data type
Interesting. Under the hood FGL is mapping the graph to relatively efficient data structures like Patricia Trees as implemented in Data.IntMap so I would expect it to scale reasonably for inserting edges and mapping over nodes. I agree the memory inefficiency is definitely a limiting factor of the library. As you say I think it is best suited for expressing graph algorithms and if those calculations become the bottle neck a custom solution can be developed with the proof of concept already in place. Out of curiosity what number of nodes/edges would you consider a "moderately sized graph"? My user cases are typically on the order of 500-1000 nodes with a similar number of edges that require bfs and topological sorting.
montmorency88··on The hunt for the missing data type
I'd highly recommend Erwigs FGL library in Haskell as a really nice example of a generally performant graph data structure that is easy to work with. The API feels like working with lists because you are essentially consing contexts(node, neighbours) into a list of contexts that form your graph. Many standard graph algorithms are then built up from depth or breadth first search and you can compose really succinct programs to manipulate the graph. Graphs are labelled with any Haskell data structure and there is a graphviz library complementary to FGL to generate dot files which can be rendered according to the data carried in the node labels. Often in an application you want to both perform computations on your graph and render a visualization simultaneously to the end user or for debugging and in FGL you minimise duplication of application and rendering logic.
montmorency88··on Show HN: ChatGPT on 2-Dimensional Map
Haha, The fact people are taking time to complain is a good sign of engagement.

Looks like fixed spacing along x and letting the cards float along y which is very effective.

I have sometimes wondered why there isn't more convergence for a standard set of primitives/libraries/template engines for drawing graphs on the web.

graphviz .dot files would seem to be a natural DSL and then there are packages like dagre/mermaid but italways seems like for applications you need to end up rolling your own.

montmorency88··on Show HN: ChatGPT on 2-Dimensional Map
Very nice idea/design. I have to ask :) Are you using a custom layout algo for drawing the nodes labels in the directed graph?
montmorency88··on Optional If Expressions
Haskell has `when cond do sideEffect` which captures the intention of an if without an else concisely.
montmorency88··on Launch HN: Baseplate (YC W23) – Back end-as-a-service for LLM apps
Hey looks very cool. Curious why you chose BASF as the example? Are you targeting engineering market in particular?
montmorency88··on Writing a simple Lisp interpreter in Rust
rustacean lisp should be called clam-bda.
montmorency88··on Lisping at JPL Revisited
Is the source code for any of these really interesting JPL lisp programs available in a repo somewhere? e.g. I'd love to look through something like Eggemeyer's Plan-IT system referenced in the article.
montmorency88··on Ask HN: How would you refactor a big project in 2023?
A tool like https://thin.dev/ might be good for you. You can port and serve functionality a little bit at a time into thin and use their managed postgres db and the schema editor to handle the new fields in the backend.
montmorency88··on Show HN: IHP v1.0 – Batteries-included web framework built on Haskell and Nix
IHP is already used in production for a number of commercial projects, but I'd also highly recommend the framework for anyone interested in just learning and hacking away with haskell. The IHP IDE is a great playground and you are automatically set up with a postgres db, ghc, hls, etc. So a lot of the configuration barrier is removed and you can just start writing Haskell and experimenting with some of the cool libraries on hackage.
montmorency88··on Deploying an IHP Project to Fly.io
I think another element is if you are a single or part of a small team of developers you realize quite quickly the value IHP adds to your project in terms of time savings:SES, Sentry, deployment... Etc. Also When you rely on IHP for anything in production you end up exploring some of the more remote corners of the design and I've found the quality is still very high even for niche features. From this perspective paying the monthly fee to keep the team developing IHP interested becomes a very good investment.
montmorency88··on Companies That Use Haskell in Production
Hey, at Comhlan Ltd. we have a few projects in production built with IHP. The largest public facing one is a visitor booking system for an irish regional hospital group we've had out since January. Happy to answer any questions but short answer is GHC+nix+IHP has made for a really robust development/deployment experience. (Disclaimer: I'm founder of Comhlan and we are a IHP platinum partner as well).
montmorency88··on Show HN: thin.dev, back end for making realtime, typesafe React Apps
I've been playing with the Thin API and prototyping some small applications (music streaming and comms type stuff). It seems like one of the most production ready ways of designing [Data-Centric Apps (https://riffle.systems/essays/prelude/).

From a developer point of view with Thin it feels like you can move directly from a schema to a user interface without having to spend a single line of code on network configuration or intermediate application layer logic.

Some of the Data-Centric patterns like storing component state in the server-DB would be really cool to play with in 'Thin'. I think being able to access your app from different devices/sessions and having the state preserved could be a fun feature and there seems like a lot of potential for multi-user collaborative type apps to be written using this framework.

montmorency88··on Hands-On with PostgreSQL Authorization – Part 2 – Row-Level Security
I first realized the usefulness/minimalism of row level security when playing with the [ihp-backend](https://ihpbackend.digitallyinduced.com/) package. It's a really lean way of moving straight from your data definitions in a schema to your application logic written in react.

I thought it was interesting because it was a change from the usual authentication cycle of storing some session information and handling all the authentication through sessions and restricted queries.

montmorency88··on MIT Scheme on Apple Silicon
Very cool how much interest there is in mit-scheme and sicm. On the csail website I think the '.com' binary for scmutils only works with v10 and was released about a year ago. Does anyone know where there are instructions for finding/compiling a version that works with the latest version of mit scheme?
montmorency88··on Haskell web framework IHP aims to make web development type-safe and easy
IHP is the best web framework experience I have had. I think a lot of aspiring haskeller's will have worked their way through a text like Learn You a Haskell For Great Good or similar and then be looking to fool around with an actual project.

IHP uses nix to cut out all the work of setting up ghc/stack/cabal which can be quite tricky for a beginner, it has just added haskell language server integration, it starts your postgres servers, it spares you from having to remember your SQL syntax, and means you can start writing haskell code instantly while getting immediate feedback on your hacking from GHCi and visually through the live reloading of the web app in your browser.

I've found the [hsx||] quasiquotes quite fun to work with and type safety has sped up development by preventing bugs that can easily crop up when you're linking forms to databases.

I like the design choices in IHP, and for me, at the moment, I like the focus on server side web app development, which encourages you to be more sparing/judicious in the use of javascript.

With IHP being opinionated about the models/views and routing it means I can focus on integrating some of the other really cool haskell libraries that exist into web apps. (I'm also trying to keep a log of my experiences here on an https://ihpcafe.ihpapp.com if you want to read along with someone figuring out function type signatures ;) )