Giter Club home page Giter Club logo

advent-of-code-2022's Introduction

Advent of Code 2022

Let's learn more programming languages! The goal of this year is to learn few languages that:

  • have been somewhat influencial on programming today
  • have interesting or unique or uncommon paradigm or features
  • have not been used in my attempt at Advent of Code 2021
  • I don't use everyday (this excludes C, C++, JavaScript, Haskell, Python etc.)

Journal

Day 1 - Common Lisp

Main reason for using this language is to learn loop macro which is wild - a whole EDSL for expressing iteration. And from first usage it seems quite nice. Whish more functional programming language have EDSLs like that.

Used sbcl implementation and documentation from Lisp Cookbook.

Day 2 - R

Encoding solution as linear algebra equations is easy - the hard part is handling input and my solution definitely can be improved by some R magic that is unknown to me.

Day 3 - Scala

It's astonishing how many of languages that I tried for this day ware hard to launch. But anyway, Scala shines in comparison both for batteries included approach and ease of use.

Day 4 - AWK

It's to easy! AWK is glorious with it's simplicity.

Day 5 - Python

Yeah I know Python but it's the best language for this task that has come to my mind. Tried Ada, Raku, Common Lisp and Haskell but in each I wasn't as satisified with direction that solution was going to.

Day 6 - C++

This problem looked like designed for standard library that can with ease convert between sets and slices of strings, and C++ is one of them. Another reason is to see how C++ looks against other languages so far, and it's not a bad look despite its bad reputation.

Day 7 - Zig (0.9.1)

"The Zig language is designed to prevent bugs by making strategic use of friction." said creator of Zig and this is the definition of the language. Cost of entry to this language is even higher then Rust beacuse toolchain is not as helpful as in Rust and documentation is not even started for most functions and types.

The preable of solution just to read file line by line is massive and I don't think that this will change soon - even Zig's hello world is so noisy after all this time. Zig seems like language optimized for larger software and this kind of one time use programs are second class citizens in it's audience.

Day 8 - Haskell

I miss rank polymorphism in every langauge that otherwise feels great. Parts like f . concat are annoying and I wish there would be a language with Haskell like syntax and rank polymorphism.

Someone added combinatory logic to this lambda calculus with phi combinator known in Haskell as flip liftM2. Reproduction of the same code patterns give birth to solve function which nicely removes code duplication with a cost of code obscuration. Haskell has this annoying property that it encourouges building opon layers of abstractions which makes algorithms hide behind the curtain made of mathematical beauty.

Next time first I shall upload simple solution and then play with combinatorial point-free toys.

If you wish to see combinators shine I recommend Combinatory Logic and Combinators in Array Languages by @codereport

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.