Frectonz
4.03K subscribers
2.08K photos
92 videos
32 files
1.79K links
A place for me to talk about my projects, stuff i find on the internet and what I am thinking about.

By @frectonz
Download Telegram
I've completed "Cube Conundrum" - Day 2 - Advent of Code 2023

https://adventofcode.com/2023/day/2

I did this one in Elm.

[Part 1 Solution] [Part 2 Solution]
🔥6
Frectonz
Model your data well and the algorithms you want will almost write themselves.
I know i said parser combinator libs are not always needed but i couldn't help myself.

Just look at it, it's beautiful.

The top level parser is game, and it has a nice hierarchy of small parsers.

game calls into cubeSets calls into cubeSet calls into cube
🔥3
I've completed "Gear Ratios" - Day 3 - Advent of Code 2023

I used OCaml 🐫 for this one.

[Part 1 Solution] [Part 2 Solution]
🔥2👏1
Frectonz
I've completed "Gear Ratios" - Day 3 - Advent of Code 2023 I used OCaml 🐫 for this one. [Part 1 Solution] [Part 2 Solution]
|> is the best

every language should have some way of composing functions by passing the output of one function as an input to another.
Resources for learning a Functional Programing Language

Elm
https://guide.elm-lang.org/

OCaml
https://dev.realworldocaml.org/

Haskell
http://learnyouahaskell.com/chapters
👍5
KiNFiSH Farms
https://www.youtube.com/watch?v=iSmkqocn0oQ what is your guys think of this @frectonz
The video shows a bunch of language designers discussing their craft and talking about the tradeoffs various languages make.

The video is not meant to be a damnation of Haskell despite the click-bait title "Haskell is useless".

The definition of "use" Simon is talking about here, is actually being able to perform side effects, which one can define as modifying state outside of your program or depending on state outside your program.

Examples of side effects are IO operations, like
  - Reading and writing to disk
  - Opening network connections and making requests
and also things like random number generation, which make functions non deterministic.

Haskell is considered "useless" in this video because it doesn't allow you to make this side effect operations, because it's trying to be fully deterministic. The realization the peeps are talking about is that actually side effects are the whole point people write programs for, like you wanna make some request to server and show the response or you wanna read data from a file and do some computation on it, and Haskell by disallowing those things, it has made itself "useless"

But that's not really right in the current situation, because Haskell does allow you to do side effects but they do have their own structure of how one handles side effects which are called monads.

And btw Simon is one of the people that actually created Haskell.

And another note
Rust is actually the result of C/C++ folks trying to move closer to the Nirvana land he described in the video.

PS: I am not really a haskell guy, the last time I wrote haskell, is probably more than 2 years ago. I just thought I would share my views since you mentioned me.
👍2
I completely agree.

[the tweet]
🔥1💯1
Frectonz
I completely agree. [the tweet]
Capitalism is the only economic system that ensures human progress. It is one of the true super powers of humanity.

It holds societies together.
It even aligns nations to prosper together.

It is magnificent.
👎7🔥6
I've completed "Scratchcards" - Day 4 - Advent of Code 2023

I did this one in golang. Part 2 took me way too long to figure out.

[Part 1 Solution] [Part 2 Solution]