UnionArgParser
nand2tetris
UnionArgParser | nand2tetris | |
---|---|---|
3 | 9 | |
444 | 46 | |
3.2% | - | |
7.8 | 4.4 | |
5 days ago | 9 months ago | |
F# | F# | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
UnionArgParser
-
From Script to Scaffold in F#
More formal argument parsing using the Argu library
-
Anyone interested in doing some 1 on 1 consulting?
Create a user interface (can start as Console.Readline() or Argu, or you can just go all in and write something with avalonia/fable)
-
Really great example projects?
Personally, I like how the Argu library is written: https://github.com/fsprojects/Argu
nand2tetris
-
OCaml at First Glance
Yes, please do! Warning: F# will ruin other languages for you. I find it rather painful to work in basically anything else after using F#, with gradients of pain for different languages. Haha.
And that's a good question. I have basically every book written on F#, but I can't say I have ever used them for anything more than reference.
The official docs/guide/reference are actually really good, and I refer to them a lot when using some feature I'm not familiar with: https://docs.microsoft.com/en-us/dotnet/fsharp/what-is-fshar...
F# For Fun and Profit is well-known, but I can't say I use it a lot: https://fsharpforfunandprofit.com/
The same author's (Scott Wlaschin) book is very good: https://pragprog.com/titles/swdddf/domain-modeling-made-func...
As for books, I have always liked:
* Functional Programming Using F# by Hansen and Rischel (might be too simple if you are already comfortable with functional programming and is out of date every now and then with changes to F# that's happened)
* Expert F# 4.0 by Don Syme and others (contains a lot of nice things by the designer of F#
One of the latest books is Stylish F# 6: Crafting Elegant Functional Code for .NET 6 by Kit Eason. I have the first edition but haven't read it.
My personal recommendation is to take the approach of type/domain driven design. That is, I start off every F# module the same:
1. Define my types with discriminated unions, records, type aliases (such as for tuples) or single case discriminated unions. Use classes when necessary but try to prefer the more functional types.
2. Start writing functions against these.
And that's basically it. One thing to recognize with F# is that it mixes OOP rather nicely. Even discriminated unions and records, which are immutable, can have members defined on them, including operator overloading (something F# is pretty good about). They can even implement interfaces and be defined with generic types, which is also nice and powerful.
I have some projects that might of interest, since they're simple enough and illustrate the above process.
https://github.com/bmitc/the-ray-tracer-challenge-fsharp
https://github.com/bmitc/nand2tetris
Lastly, I'd suggest just starting up some projects. You could also take the Programming Languages course on Coursera by Dan Grossman. Part A uses SML, and you could port the examples and homework solutions to F# (I did so when I took the course). I also take books written for other languages and port the code to F#, usually taking a more idiomatic functional style. .NET Interactive notebooks (https://github.com/dotnet/interactive) are a great way to get started. You just need to install the .NET 6 SDK (which gets you F#) and then install the .NET Interactive Notebook extension in VS Code. That's it. There is also the book The Little MLer which gets people comfortable with discriminated unions (sum types), and I used the book and ported the examples to F#. I need to go back and finish that annotation project (https://github.com/bmitc/the-little-fsharper). I'll probably convert the script files to .NET Interactive notebooks if I do.
- Really great example projects?
- What are F#'s advantages?
-
Learning FPGA design, specifically creating a computer.
See references here: https://github.com/bmitc/nand2tetris
- Recommended books/online courses for getting in FPGA/VHDL?
-
Can anyone suggest any interesting F# projects?
One project I have been doing is implementing the software stack from the Nand2Tetris course in F#. You can find my repository here: https://github.com/bmitc/nand2tetris
-
The Elements of Computing Systems, Second Edition
I love this book (the first edition), project, and course.
It is incomplete, but I thought I would share my implementation of the software stack in F#. Currently, only the assembler is implemented, but in my personal opinion, I think it showcases the beauty of F# for domain modeling. When I return to the project, I hope to restart the VM implementation and continue adding to the FPGA implementation as well. My eventual goal is to have the entire software stack built using F# that can than be run on an FPGA implementation of the CPU.
https://github.com/bmitc/nand2tetris
-
making illegal states unrepresentable with types
I even have a comment mentioning this: https://github.com/bmitc/nand2tetris/blob/3e145df44a97e2df094c585a1e97b7b1713dc582/dotnet/Nand2Tetris/Assembler/Types.fs#L90
-
Don Syme on why C#'s new pattern matching is a bad design
If you scroll down to #2 in this repository, I show an example of active patterns in use. The active pattern is defined here. This particular active pattern is described in the docs even, but I find it extremely useful for parsing. It basically allows you to build a sane parser that takes in a string and maps it, via regular expressions, to a discriminated union. That means that your parsing step will generate known types that can be exhaustively pattern matched, making it basically impossible for your downstream functions to have an error due to an unhandled parsing step.
What are some alternatives?
EntryPoint - Composable CLI Argument Parser for all modern .Net platforms.
the-ray-tracer-challenge-fsharp - F# implementation of the ray tracer found in The Ray Tracer Challenge by Jamis Buck
ReadLine - A Pure C# GNU-Readline like library for .NET/.NET Core
fslang-suggestions - The place to make suggestions, discuss and vote on F# language and core library features
clipr - Command Line Interface ParseR for .Net
mal - mal - Make a Lisp
Power Args - The ultimate .NET Standard command line argument parser
WebApiTest - Sustainable Web API written in F# that showcases the language's strengths via a functional style.
CliWrap - Library for running command-line processes
CardManagement
Docopt - Port of docopt to .net
adventofcode - Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in Scala