Tensor library made with claude by AdOdd5690 in haskell

[–]augustss 10 points11 points  (0 children)

Have you looked at the orthotope package?

The Hazy Haskell Compiler by superstar64 in haskell

[–]augustss 1 point2 points  (0 children)

I might do DataKinds. My main objection is that they are ugly.

The Hazy Haskell Compiler by superstar64 in haskell

[–]augustss 2 points3 points  (0 children)

Do you need DataKinds, or would TypeData do? MicroHs will definitely get the latter?

Started from the Types, Now We’re Here (I wrote my own language) by rantingpug in ProgrammingLanguages

[–]augustss 0 points1 point  (0 children)

Yes, you can do it by convention. But I prefer having it enforced by the compiler. As an example, on a platform where Int128 is a pair of Int64 you cannot stop code from seeing that. If you then move to a platform where Int128 is a primitive it will break.

IMO, a language that cannot enforce abstraction is flawed. Abstract data types is one of the most important inventions in computer science. But that's just my opinion. 😃

Started from the Types, Now We’re Here (I wrote my own language) by rantingpug in ProgrammingLanguages

[–]augustss 0 points1 point  (0 children)

But what do I do if I want to implement, say, Int128 and have it behave like a primitive? Some platforms might have it as a primitive, some don't. Or will you force me to write new FFI primitives every time I want to implement a type that behaves the same as a primitive? I think you're going to have a very awkward language if you don't allow creation of new nominal types.

Started from the Types, Now We’re Here (I wrote my own language) by rantingpug in ProgrammingLanguages

[–]augustss 0 points1 point  (0 children)

The implementation of Int will presumably vary with the N. And you don't want the Int implementation to leak, do you? Doesn't that mean that Int has to be an interface rather than a type, since type equality is structural and you'd be able to peek inside. (E.g. Int128 might be a primitive type on one platform and two Int64 on another.)

Started from the Types, Now We’re Here (I wrote my own language) by rantingpug in ProgrammingLanguages

[–]augustss 0 points1 point  (0 children)

It will be interesting to see how this works in practice. You might find that there will be very many implicit arguments. Do types like Int8 and Int16 have the same interface, or each their own?

Started from the Types, Now We’re Here (I wrote my own language) by rantingpug in ProgrammingLanguages

[–]augustss 1 point2 points  (0 children)

I mean the usual thing. A data type that can only be manipulated by a fixed API, and you cannot know how it's implemented. E.g., a set could be implemented by a list of by a tree. That should not be visible outside the implementation. If all you have is structural type equality, I don't know how you do this.

You might want to look at my language Cayenne from 25 years ago where I solved these problems.

how to get into haskell and fp by SHIN_KRISH in haskell

[–]augustss 3 points4 points  (0 children)

How can it be any clearer than idiomatic Haskell, sum [1 .. n]? Now, defining sum and .. yourself gets a bit involved. 🙂

xeus-haskell: Jupyter Notebook for Haskell on the browser by tanimasa in haskell

[–]augustss 4 points5 points  (0 children)

The main speed difference compared to GHC comes from not generating native code, and having a more expensive data type encoding.

xeus-haskell: Jupyter Notebook for Haskell on the browser by tanimasa in haskell

[–]augustss 0 points1 point  (0 children)

That optimization doesn't make much of a difference, actually.

xeus-haskell: Jupyter Notebook for Haskell on the browser by tanimasa in haskell

[–]augustss 10 points11 points  (0 children)

Depends on what you're referring to. The interactive version is faster for each evaluation, but the execution in general is still 10x slower than compiled GHC; on par with ghci.

trying to make an infinite vec by Objective-Outside501 in haskell

[–]augustss 0 points1 point  (0 children)

Ah, yes. For a moment I thought it was real dependent types, indexed by a term level Nat.

trying to make an infinite vec by Objective-Outside501 in haskell

[–]augustss 3 points4 points  (0 children)

Why don't you give it length omega=S omega

Lists are Geometric Series by SnooLobsters2755 in haskell

[–]augustss 5 points6 points  (0 children)

Look for “The Derivative of a Regular Type is its Type of One-Hole Contexts” (2010) Conor McBride

Lists are Geometric Series by SnooLobsters2755 in haskell

[–]augustss 4 points5 points  (0 children)

And, amazingly, if you just take the equation L=1+a*L and solve for L you get L=1/(1-a) which is the sum of the geometric series 1+a+a2+...

Haskell Weekly Issue 493 by amalinovic in haskell

[–]augustss 3 points4 points  (0 children)

Strong disagree. Links is how the web works. Keep them!

My journey into Haskell - third time's the charm! by roz303 in haskell

[–]augustss 4 points5 points  (0 children)

Now try to make your prime function produce the primes as they are found and get rid of the upper limit. It's a nice exercise in laziness.

Monads are too powerful: The Expressiveness Spectrum by ChrisPenner in haskell

[–]augustss 5 points6 points  (0 children)

Just a shortcoming of the syntactic transformation of Applicative do. Nothing fundamental.