Best for:
- Full engineering sessions with iterative work
- Multiple related tasks that build on each other
- Maintaining conversation context across tasks
- When you want consistent engineering constraints throughout
Best for:
| use std::fmt::debug; | |
| type CustomerId = i32; | |
| type InfringementId = i32; | |
| pub enum Event { | |
| Init, | |
| Build, | |
| Execute, | |
| Done, |
Inspired by the 300k USD Donation Pledged by Mitchell Hashimoto I decided to finally give Zig a look and see what all the fuss is about. I was curious what people meant by the simplicity of using something called "a modern C replacement". Rust has satisfied my low-level programming with safety itch, but people aren't wrong when they say it's a complicated language. What does a simple language look like in 2024?
Naturally, the first step to testing a language is finding a suitable project or domain to tackle. I love command line tools, and while it seems incredibly cliche, I've made it my goal to write a text editor of sorts. A true programmer's trial of ascension.
One of the first problems that needs solved when building a text editor is the matter of how you store and represent the text internally. There's a lot of naive approaches, such as storing each character in an array, or each line in a 2d array. However, those methods can be very in
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| module Main where | |
| import Control.Lens | |
| import GHC.Generics |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeSynonymInstances #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Main where | |
| import Data.Coerce |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeSynonymInstances #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Main where | |
| import Data.Coerce | |
| import Data.Tagged | |
| data Validated |
| module Main where | |
| import Data.Coerce | |
| data Validated | |
| data Unvalidated | |
| class AbstractError e | |
| data MyError = MyError String deriving (Show) |
| { compiler ? "ghc844" }: | |
| let | |
| nixpkgs = import <nixpkgs> {}; | |
| inherit (nixpkgs) pkgs stdenv; | |
| in | |
| # Make a new "derivation" that represents our shell | |
| stdenv.mkDerivation { | |
| name = "servant-dev"; |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| module Main where | |
| -------------------------------------------------------------------------------- | |
| import Data.Coerce | |
| import Data.Foldable | |
| -------------------------------------------------------------------------------- |
| { compiler ? "ghc865" }: | |
| let | |
| nixpkgs = import <nixpkgs> {}; | |
| inherit (nixpkgs) pkgs stdenv; | |
| in | |
| # Make a new "derivation" that represents our shell | |
| stdenv.mkDerivation { | |
| name = "communication-dev"; |