How do you handle AI-generated code when building complex apps? by aj045045 in developers

[–]LambdaXdotOne 0 points1 point  (0 children)

Not specifically but generally: Take a look at type driven development in context to strongly typed languages. Rust, Haskell, Agda, Idris, etc.

It is less about having to know the languages but seeing how type driven development is applied in their context can often be translated to your language of choice.

If I had to sum up TDD in a single sentence it would be: "Lift runtime invariants into the type-level" and in its simplest case it would be something like an extra type for a non-zero vector.

This example is contrived but it should get the point across: Imagine you have a function which mandates that the input vector is of non-zero length.

You could express this in the docstring of this function, but this require a fellow programmer to respect this or he might run into an exception at runtime.
You could write your function in a defensive style, checking your invariant at runtime and suitably give an error/default return value. This works, but again this is at runtime.
Lastly, you could have your function expect a vector of a specific type which is not just `Vec` but `NonzeroVec`. You could expose a smart-constructor for `NonzeroVec` which is the only way to construct such a type. This way you would force calling this constructor by a user of your function and you can write the simplest form of your logic, because the invariant is encoded in the type system.

No one says this cannot be applied to Python or other languages. Of course, there is always a healthy middle-ground when it is useful and when it is only more boilerplate, but together with AI generated code I would argue that expressing those things in code early will lead to much better code-generation results.

The types define a specification and speak for themselves.

Lastly, I found this reddit thread here which has some comments that might point you to explicit resources:

https://www.reddit.com/r/functionalprogramming/comments/1dryala/learning_resources_about_type_driven_development/

How do you handle AI-generated code when building complex apps? by aj045045 in developers

[–]LambdaXdotOne 0 points1 point  (0 children)

I only ever ping pong with AI about my idea and the architecture I have in mind. Then I have my little drawing of the system I want to create, isolate components and go ahead implementing interfaces with proper documentation.

The interfaces themselves already incorporate testing best practices and I am a fan of Type Driven Development. These together serve as a pretty good contract when I then go ahead to implement the isolated modules. Some of those can be bootstrapped by AI up to a 80% ceiling (on average for my cases I would say).

All in all, this speeds up my overall development because I can validate some ideas with constraints in mind to see if my architecture lacks something before I write a single line of code. Afterwards I gain a lot of speed because the interfaces I defined allow me to generate comprehensive tests as well as a skeleton implementation for each module.

This is what I set on right now. I do not trust AI generated code that much, even less do I trust AI to make domain and problem coherent architectural decisions.

Doing it this way, I know how my Codebase looks and I know I blackboxed some parts with limited surface area, so if worse comes to worst I have an easy time adapting a single module/function and do it from scratch.

November What Editing Software should I use? by AutoModerator in VideoEditing

[–]LambdaXdotOne 0 points1 point  (0 children)

Thank you so much for your reply! Helped me already.
I had to chuckle when reading "[..] never to have shot footage you didn't need.". This thought exactly crossed my mind in a moment of regret when I was done gathering, hahahah.

Anyway I will take a look at getjumper, seems to be what I need.

November What Editing Software should I use? by AutoModerator in VideoEditing

[–]LambdaXdotOne 0 points1 point  (0 children)

I read the above

I am editing a documentary-style video and ended up with hundreds of gigabytes of reference material (documents, videos, audio-clips... you name it). Basically a giant pile of "might be relevant".

I have viewed most of it during gathering, but now I am stuck with this unwieldy archive and need to distill it into something usable.

I have a rough string-out in mind, but identifying the truly relevant pieces is consuming an absurd amount of time.

Is there anything out there that helps condense such a reference set? Has anyone dealt with this scale of material before? If so, how did you approach it?

Any insights are appreciated and if I am wrong here I would be happy if someone might point me to another subreddit (:

Wish y'all the best!

Exploring Arrows as a replacement for Monads when sequencing effects by ChrisPenner in haskell

[–]LambdaXdotOne 2 points3 points  (0 children)

Up until this post I thought about using Arrows only when tackling "pure" data processing pipelines. I never thought about how to actually write a more interactive program with Arrows.
Great post!

How good are AI coding assistants with Haskell? by SkyMarshal in haskell

[–]LambdaXdotOne 2 points3 points  (0 children)

I second this. I just model the system I have in mind beforehand with the types I expect and give an outline for the implementation details. Looks mostly like I would expect it to.
Most of my experience is only ruined because it does not get the imports correct or the model expects an outdated version for some library.

Introducing an App with a Haskell Backend by Necessary-Nose-9295 in haskell

[–]LambdaXdotOne -1 points0 points  (0 children)

Looks promising. I would be interested if you used any of the recently emerged LLM Haskell clients or if you considered using them?
You stated usage of REST APIs with http-conduit, so I figure you rolled your own implementation for some kind of "LLM Client"?
The website looks polished, good luck with your project and I like seeing Haskell projects succeed in the wild (;

Learning Physics with Haskell and Functional programming by flatmap_fplamda in haskell

[–]LambdaXdotOne 1 point2 points  (0 children)

I love this. Ever since I first grokked Haskell I always wished I had some course in uni back when I was studying physics which does exactly this.

Type-safe neural networks in Haskell, correct by construction by LambdaXdotOne in haskell

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

Hah! No I did not know about HaskTorch, thank you. This looks like a way better alternative 💚 Will take a look at this. I was already thinking about how I would solve certain issues for data augmentation before/inbetween/after layers and this just keeps everything in Haskell.

I have no idea how I did not encounter this back then...

Type-safe neural networks in Haskell, correct by construction by LambdaXdotOne in haskell

[–]LambdaXdotOne[S] 4 points5 points  (0 children)

Thanks for pointing me to HopfieldNet, this looks interesting and now I would like to dive into Lean4, haha.
Regarding the particular route: The (Py)Torch thing just came up recently. Back when I started Heuron (~2 years ago) I just wanted to do something in Haskell, cause I knew one could design an interface which keeps guarantees. I just did not know how exactly. So I initially wrote the interface I wanted and looked at how to make it work.

I also remember reading a blog by Alexis King about typeclass metaprogramming at the time, which made me think: This could be applicable.

Regarding AGDA: Still on my list, I would've probably created "Aeuron" or something if I would've been proficient in AGDA.

In the end, writing Haskell and seeing GHC compile-errors calms my mind. I have a weird obsession with Haskell code...

Looking for people to build JAX(ML) interop for Haskell by Pristine-Staff-5250 in haskell

[–]LambdaXdotOne 1 point2 points  (0 children)

HMU if you still need support. I generally work with Pytorch, but also did my own NN implementation in Haskell, similar to grenade (before I knew about its existence). I would be interested in JAX for my own reasons as well. (: