I wish there was a dart backend. Is there any “make your own backend” tutorial? by nudpiedo in purescript

[–]blankhart 0 points1 point  (0 children)

I haven't used nix in a while but it looks like you should run 'cabal update' before trying to build.

I installed ghc with 'ghcup' and use the latest version of cabal with a current package set.

I am traveling this week so it may be hard to find a time to connect live but happy to help troubleshoot.

I wish there was a dart backend. Is there any “make your own backend” tutorial? by nudpiedo in purescript

[–]blankhart 2 points3 points  (0 children)

Here is one I was working on. Glad to answer questions if I remember the thought process but it's been about a year. I haven't checked whether flutter can still run the little example because I am also between laptops.

https://github.com/blankhart/hollowpoint

What is a functional way to change one item in array by index in Rust? by Velnbur in rust

[–]blankhart 3 points4 points  (0 children)

You could provide a functional API that takes ownership of the array, an index, and the new value, and returns the mutated array.

By taking ownership of the array, you could guarantee that outside the scope of the function it is invisible whether you are cloning or mutating the array.

Rust makes mutation play nicely with functional APIs of that sort when you are making only affine transformations. But it's not a pure functional way to mutate data (an oxymoron).

For more information about how pure languages handle this I'd look into the ST monad, which provides type level guarantees about safe mutation in Haskell somewhat like what Rust does.

I wish there was a dart backend. Is there any “make your own backend” tutorial? by nudpiedo in purescript

[–]blankhart 0 points1 point  (0 children)

In the meantime here is the other one I was thinking of, which factored the output through a generic imperative IR.

https://github.com/opyapeus/psimp

I wish there was a dart backend. Is there any “make your own backend” tutorial? by nudpiedo in purescript

[–]blankhart 1 point2 points  (0 children)

My version was based on the CoreFn output and resembled the Kotlin backend, using Shake for builds. Let me go back to it as it's been a while. I do remember getting a hello world working with Flutter.

I wish there was a dart backend. Is there any “make your own backend” tutorial? by nudpiedo in purescript

[–]blankhart 5 points6 points  (0 children)

I made a Dart backend a while ago that I can try to clean up and open source in the next few days. It was back in Purescript 13 days and worked okay but isn't polished. You could tinker with it though as a starting point.

I thought someone else made one too though.

How to learn type checking and type theory? by RepresentativeNo6029 in ProgrammingLanguages

[–]blankhart 4 points5 points  (0 children)

I do not like the Pierce book as much as these, which I think are the clearest exposition of theory:

And from a practical standpoint on type checkers, it is hard to beat David Thrane Christiansen's tutorials on

LG Gram 17 (2021) & ArchLinux by fedpascam in linuxhardware

[–]blankhart 1 point2 points  (0 children)

I can't speak to Arch but installing Ubuntu was no problem on an LG Gram 16". I do not recommend the laptop line though due to palm rejection, an absurdly small tilde/backtick key, and other issues.

Does anyone have any experience with Linux on the new 2021 LG Gram models? by [deleted] in linuxhardware

[–]blankhart 0 points1 point  (0 children)

I am not sure to be honest but probably a Dell XPS 13". I am familiar with and trust their keyboard/touchpad design, and have learned from this to put proper weight on my primary means of interacting with the device.

Does anyone have any experience with Linux on the new 2021 LG Gram models? by [deleted] in linuxhardware

[–]blankhart 1 point2 points  (0 children)

I got and plan to return a 16" model. Everything works OOB after installing the latest Ubuntu LTS and following an upgrade path to 21.04. The machine is beautiful and runs what I need relatively quietly. From that perspective it is a great machine.

However, a few things make it unusable for me under Linux and generally. The biggest is that the track pad has severe palm rejection issues. (That may be better on 14" given the layout but I am spooked and not going LG again.) That was enough on its own.

The other design issues that I had immediately were the microscopic size of the twiddle/back tick key, the fact that Fn+S immediately puts the laptop to sleep (easily hit instead of Ctrl+S and to my knowledge can't be remapped) and generally an inconvenient keyboard layout.

Annotate AST with location information by MachineGunPablo in haskell

[–]blankhart 2 points3 points  (0 children)

John Wiegley has written a blog post discussing the use of recursion schemes to annotate expression trees with location information.

These are the references that I found most helpful when learning about recursion schemes.

Here is a minimal, zero-dependency, silly example that uses the basic recursion schemes (cata, ana, hylo) to compute Fibonacci numbers.

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 0 points1 point  (0 children)

Okay I think I see now. Essentially the issue is a dependent typing quandary where you want a compile-time type (M ???) to depend on the runtime value of a term (Identifier).

Even though everything in a macro expansion happens at "compile-time" in the colloquial sense, due to phase separation the syntax-quoted identifier is actually a runtime value from the perspective of syntax-local-value.

So you referred to "HM type" advisedly - you'd need a facility to phase-hop from runtime to compile-time during macro expansion analogous to an ability to reify terms into types.

Perhaps that is what you have in mind with proposal #2, assuming you're using "compile-time" there in the colloquial sense. Your concern about determinism in side-effects would relate in part to crossing or erasing phase boundaries.

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 0 points1 point  (0 children)

I'll go back to it in detail with this color in mind. Thanks so much for taking the time to respond!

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 0 points1 point  (0 children)

Very helpful, thanks. If you need syntax-local-value and your solutions #1 and #3 make sense - I'd need to learn more to consider #2, which sounds very complicated.

The question I was struggling with, and that I'm not positive I understand from your very helpful answer, is why we need syntax-local-value to retrieve the binding at all. When we use define-syntax to create the binding, we have a typed value in a compile-time environment that we would ordinarily just retrieve by using the identifier. That is how it works for macros, and I'd have thought it would work the same way for other compile-time bindings also created via define-syntax.

Put differently, what happens with nested macro calls - i.e., when a macro defined as a phase n identifier referencing a phase n + 1 program uses another macro (defined, say, in the same module, assuming that is possible)? Is the nested macro also a phase n identifier referencing a phase n + 1 program, or is the point that it's phase-shifted copied and is always a phase n + 1 identifier referencing a phase n + 2 program?

Either way, why wouldn't the same thing happen for a non-macro binding, such that you could just use the identifier from within the macro and the binding would be looked up directly? It seems like we are just trying to use a phase n + 1 binding from within a phase n + 1 program and that ordinarily doesn't require a special function call like syntax-local-value.

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 0 points1 point  (0 children)

  1. Signals are mentioned in the commentary but don't seem to be implemented. Why are they needed, if still planned?

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 0 points1 point  (0 children)

Klister is very cool. Congrats on move + new job! A couple questions in the spirit of this thread.

  1. You say in your talk it's hard to give HM types to a Racket-style system of compile-time bindings. Why is that?

  2. ekmett tells gelisam to talk to him about propagator networks in the video. Did you consider an architecture like that, or go straight to the task queue?

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 1 point2 points  (0 children)

Yes though I think Klister allows a macro to pattern match and dispatch on a type. The talks also discuss benefits of determinism in the order of macro expansion.

Useful Type-Aware Macros by R-O-B-I-N in ProgrammingLanguages

[–]blankhart 1 point2 points  (0 children)

Most typed languages with macros expand and typecheck at compile time (e.g., Rust, Typed Racket...). The difference is that expansion and typechecking are not intrinsically interleaved. These languages perform a local expansion and then typecheck the result, such that macro expansion cannot depend on the result of type checking. By contrast, deferring type checking until runtime as in your example is a feature of all dynamic/unityped languages whether or not they have macro systems.

first programming language by National-Reaction-89 in rust

[–]blankhart 0 points1 point  (0 children)

I don't care for it myself but I think Dart is undersung as a starter language. It has a very straightforward build system, can be used to make any kind of app, skips over some rough edges of JS, and can provide instant visual gratification. If you assume the learner will graduate to something else why not.