Being able to build and distribute static executables is a big factor @Joel McCracken . I'm hoping for static Haskell executables official support to be merged in nixpkgs sooner. Until then, people have to glue it together manually (see dhall, which does it)
Idea: a CLI app like https://github.com/kowainik/summoner#tui-demo - but for pandoc conversion. Since pandoc is written in Haskell, the app can just use it as a library for providing better UX (re: feedback, errors).
Okay, with this: https://twitter.com/sridca/status/1310925718948319234 - if we create a "template" bootstrap repository for new Haskell projects that builds static binaries, and uses Nix to provide reproducible builds, as well bulitin VScode support ("one-click" even) ... would it help @Joel McCracken ?
Success at producing static binary for a reasonably simple Haskell #Nix project using:
- pkgsMusl of nixpkgs
- Revert of a commit in nixpkgs (to use GHC 8.6.3 bootstrap bin)
- Extra config flags as documented in static-haskell-nix repo
(This project uses reflex & reflex-dom) https://twitter.com/sridca/status/1310925718948319234/photo/1
- naivet茅 - the most liberal condition ever possible (@sridca)
haskell.nix provides Windows support for static binaries, apparently. Do we really care about naive Windows support though? I can make a GitHub repo either way, but GitHub Actions wouldn't work, unless we host a cache. Static builds will build the entire universe. If the cache takes <10G we can use cachix.
No template (I think it is best to wait till nixpkgs upstream obviates step 2 of having to do a nixpkgs fork), but see: https://www.srid.ca/db359075.html
If you just want to build static Haskell executables right now, follow these instructions. This issue collects/links all issues and ongoing work to make fully-static building of Haskell executables...
If anyone wants to start a Haskell CLI project, use this repo as a template (just remove the src/Ka stuff, and clean ka.cabal): https://github.com/srid/ka
Run nix-build static.nix to give you a static binary.
There is a ci.nix that you can use to do that as well.
so @Sridhar Ratnakumar did anything change re: os x static binaries? I think its fine personally btw if i can make everything static except for the os lib
well again the real issue is "what does it take to run this on another system, do i have to install a lot of dependencies", not "is this a purely static binary"
if everything is static besides the few system libs and those libs have a stable ABI, hyou'd still be able to download the executable and run it right away, right?
probably. you might want to check out how dhall does it. i did try their macos binary on my mac, but it refused to run it giving some security excuse. apple sucks; just throw your macbooks in the trash.
really the only reason I still use it because its nice to be able to like plug in a device and have it work and print something randomly if I need to with a new printer
linux has gotten pretty good these days. i run x1 cabon connected to one thunderbolt that charges, runs a 5k monitor (retina), connects to speakers, yeti microphone, ethernet etc.. full report
I鈥檓 considering buying a new laptop, and I obviously want to install NixOS on it. In the past, I鈥檝e had various difficulties with different Linuxes (NixOS including) with almost all the laptops I鈥檝e had. Which laptops do you use for NixOS? Have you had any problems? Which laptops would you consider to get along best with NixOS?
Each year, my favorite open source software survey asks "Where is the future of open source taking us?" I think we have to address and made big changes to user experience. Not just user interface, but the whole experience.
Idea: a CLI app like https://github.com/kowainik/summoner#tui-demo - but for pandoc conversion. Since pandoc is written in Haskell, the app can just use it as a library for providing better UX (re: feedback, errors).
What I took from that post is that even as a solo developer I can pay extra special attention to UX of my app. So be both a programmer and UX specialist myself. Of course, in larger projects it is good to have a mix of people.
@taylorfausak@hdgarrood In @kowainik we develop many CLI tools in Haskell, and it's a lovely experience! Though, adding cool things like "coloured output" is more difficult than it should be... We've created the `colourista` library for this, but something like "disable colouring easily" is challenging.
I just had an idea: a notes viewer, with full backlinks (with surrounding context, because Pandoc AST power), in command line. uses reflex FRP to auto-refresh.
Perhaps too trivial to mention, but I wrote a simplistic rlwrap clone because I wanted readline bindings for the sqlite3 shell on Windows (without recompiling the shell itself). https://gist.github.com/danidiaz/97edc1bf248f5dce34aeb3703633a4c3 haskeline seems like a nice library.
As an aside, I'm blown away by how popular Python has become! When I first started out in ~2003 I was begging my college mates to try it (Java/C++ were the curriculum based things back then) :-P
Here's an idea for a CLI app in Haskell. Write a mood tracker program that records daily moods, and prints a nice coloured calendar on the console, that you can (optionally) drill down.
So to some extent I think an answer to this can be CLI scripting
its really nice to make CLI utilities in haskell IMO
personally I want to keep pushing to make this easier
thoughts? I think if it was better documented how to build and distrbute static executables haskell could really shine in this arena
Rust community is doing this extremely well. See https://lobste.rs/s/2mxwdm/rewritten_rust_modern_alternatives
You make an interesting point. Neuron is one such CLI :-D and I'm in the middle of planning for another one.
(Go does it as well)
Being able to build and distribute static executables is a big factor @Joel McCracken . I'm hoping for static Haskell executables official support to be merged in nixpkgs sooner. Until then, people have to glue it together manually (see dhall, which does it)
On the other hand, being able to run haskell source using cabal or stack script mode is quite convenient compared to opaque static binary.
yeah, they both are great options to have
Idea: a CLI app like https://github.com/kowainik/summoner#tui-demo - but for pandoc conversion. Since pandoc is written in Haskell, the app can just use it as a library for providing better UX (re: feedback, errors).
Sridhar Ratnakumar said:
that's a pretty neat list
Okay, with this: https://twitter.com/sridca/status/1310925718948319234 - if we create a "template" bootstrap repository for new Haskell projects that builds static binaries, and uses Nix to provide reproducible builds, as well bulitin VScode support ("one-click" even) ... would it help @Joel McCracken ?
Success at producing static binary for a reasonably simple Haskell #Nix project using: - pkgsMusl of nixpkgs - Revert of a commit in nixpkgs (to use GHC 8.6.3 bootstrap bin) - Extra config flags as documented in static-haskell-nix repo (This project uses reflex & reflex-dom) https://twitter.com/sridca/status/1310925718948319234/photo/1
- naivet茅 - the most liberal condition ever possible (@sridca)static binary with reflex-dom, really???
obelisk too?
dude i thiknk you actually are suggesting my ideal fix
i mean i dont care either way about the nix part
but if you could like make it a github repo with actions that will built the static binaries
that would probably be a huge boon
nix would probably be good because it gives a good solution for managing dependencies
well hmm
what about windows?
i mean perhaps we could figure something else for windows
can you do nix on like cygwin
or whichever flavor of that same mess is in favor this month
nix on WSL seems to work fine
well that would be good but like
you'd have to run it IN wsl right?
thats better than nothihng
haskell.nix provides Windows support for static binaries, apparently. Do we really care about naive Windows support though? I can make a GitHub repo either way, but GitHub Actions wouldn't work, unless we host a cache. Static builds will build the entire universe. If the cache takes <10G we can use cachix.
For windows, I recommend WSL2. Much easier. That's what Windows users of neuron do.
Then you can use nix for linux.
Joel McCracken said:
You can run it from
cmd.exe
. Just prefix your CLI withwsl
. Eg:wsl neuron rib -w
Torsten Schmits said:
Yes, I have a working version for Linux here: https://github.com/srid/neuron/pull/417
Trying out macOS now ...
ill try making it work with reddup
if you think your setup is ready for a tester
demo: https://public.srid.ca/list/neuron-static-linux/neuron
Could someone with a mac that also have homebrew installed test this? https://unix.stackexchange.com/a/385720/14042
Joel McCracken said:
No template (I think it is best to wait till nixpkgs upstream obviates step 2 of having to do a nixpkgs fork), but see: https://www.srid.ca/db359075.html
i can test on a mac; not right now but if i dont follow up in a few days ping me and tell me I am a bad person and I will
Sridhar Ratnakumar said:
I first tried installing noah with nix, but it failed to run because
noahbootsrap
was missing.Next I tried with brew:
It successfully ran (
$ noah
), but failed during bootstrap withI tried running
noah neuron
with it anyways, but it did nothing and exited with status code 0.I guess it's no surprise, given that the project is no longer maintained and the repo is archived: https://github.com/linux-noah/noah
This seems to be the issue I ran into: https://github.com/linux-noah/noahstrap/issues/5
So I guess we will provide static binaries for Linux only, unless someone can figure it out for macOS.
Right. Since fully static binaries are apparently not supported on MacOS. https://github.com/NixOS/nixpkgs/issues/43795#issuecomment-701108479
If anyone wants to start a Haskell CLI project, use this repo as a template (just remove the src/Ka stuff, and clean ka.cabal): https://github.com/srid/ka
Run
nix-build static.nix
to give you a static binary.There is a ci.nix that you can use to do that as well.
/cc @Joel McCracken
Alternatively just copy over the .nix files to your repo.
Is there a good library for pretty printing with colors and unicorns in terminal?
unicorns? like random emoji
so @Sridhar Ratnakumar did anything change re: os x static binaries? I think its fine personally btw if i can make everything static except for the os lib
IDK. Whatever the cool kids in Rust/Go land do to make their CLI apps pleasing.
i gave up on osx static binaries.
well again the real issue is "what does it take to run this on another system, do i have to install a lot of dependencies", not "is this a purely static binary"
if everything is static besides the few system libs and those libs have a stable ABI, hyou'd still be able to download the executable and run it right away, right?
probably. you might want to check out how dhall does it. i did try their macos binary on my mac, but it refused to run it giving some security excuse. apple sucks; just throw your macbooks in the trash.
agreed
hate apple's new stuff
really going downhill
really the only reason I still use it because its nice to be able to like plug in a device and have it work and print something randomly if I need to with a new printer
i'd be really uncomfortable with giving a talk at a place on a linux computer for example, who knows how it will react with random projector
anwyay yeah
ill check out dhall
linux has gotten pretty good these days. i run x1 cabon connected to one thunderbolt that charges, runs a 5k monitor (retina), connects to speakers, yeti microphone, ethernet etc.. full report
Yeah i've heard similar things. I plan to explore it, perhaps things have gotten better enough where my next computers will be linux
probably gonna get a system 76 or a puresim
laptop advice from nixos'ers: https://discourse.nixos.org/t/best-laptops-for-nixos/8545?u=srid
Unless you are gaming, try to avoid nvidia graphics.
Another vector to consider when writing CLI apps in Haskell. Create awesome UX:
https://opensource.com/life/15/3/user-experience-open-source-future
Good post, although the article focuses more on open source projects collaborating with designers.
Where can I find a designer to collaborate with?
Sridhar Ratnakumar said:
https://lobste.rs/s/zgsdgg/customizing_pandoc_generate_pdf_epub
Winston Troughton said:
What I took from that post is that even as a solo developer I can pay extra special attention to UX of my app. So be both a programmer and UX specialist myself. Of course, in larger projects it is good to have a mix of people.
https://twitter.com/ChShersh/status/1317467542634614785
@taylorfausak @hdgarrood In @kowainik we develop many CLI tools in Haskell, and it's a lovely experience! Though, adding cool things like "coloured output" is more difficult than it should be... We've created the `colourista` library for this, but something like "disable colouring easily" is challenging.
- Dmitrii Kovanikov (@ChShersh)if err != null
does CLI too: https://news.ycombinator.com/item?id=24810312I just had an idea: a notes viewer, with full backlinks (with surrounding context, because Pandoc AST power), in command line. uses reflex FRP to auto-refresh.
https://www.joachim-breitner.de/blog/776-Distributing_Haskell_programs_in_a_multi-platform_zip_file
Sridhar Ratnakumar said:
Worth noting that these instructions are nix-specific (so they aren鈥檛 much help for people like me who work on Windows).
It mentions windows
it mentions it in the context of working on linux and building for windows
Use WSL2
Perhaps too trivial to mention, but I wrote a simplistic rlwrap clone because I wanted readline bindings for the sqlite3 shell on Windows (without recompiling the shell itself). https://gist.github.com/danidiaz/97edc1bf248f5dce34aeb3703633a4c3 haskeline seems like a nice library.
This topic was moved by Sridhar Ratnakumar to #Rust > Unix shell in Rust
Someone wrote a CLI tool in ... not rust, not haskell, but ... Python. It got >1k votes in HN, >3k stars on GitHub right away.
As an aside, I'm blown away by how popular Python has become! When I first started out in ~2003 I was begging my college mates to try it (Java/C++ were the curriculum based things back then) :-P
From a comment.
haha
Here's an idea for a CLI app in Haskell. Write a mood tracker program that records daily moods, and prints a nice coloured calendar on the console, that you can (optionally) drill down.
For reference, here's a Python CLI for managing events: https://github.com/pimutils/khal
Some inspiration from the dotnet community, https://spectresystems.github.io/spectre.console/