Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
The March Hare
Oct 15, 2006

Je rêve d'un
Wayne's World 3
Buglord
Does anyone have a good resource for gaining an understanding of category theory for code bros who know almost nothing about math? It's OK if this isn't a thing, but if it is I'd appreciate a recommendation for a decent resource.

Adbot
ADBOT LOVES YOU

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

The March Hare posted:

Does anyone have a good resource for gaining an understanding of category theory for code bros who know almost nothing about math? It's OK if this isn't a thing, but if it is I'd appreciate a recommendation for a decent resource.

I've seen this recommended: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/

fomo sacer
Feb 14, 2007

The March Hare posted:

Does anyone have a good resource for gaining an understanding of category theory for code bros who know almost nothing about math? It's OK if this isn't a thing, but if it is I'd appreciate a recommendation for a decent resource.

I like Categories For Scientists (edit: here is the current edition of the book from the publisher's website as ugly HTML instead of an ugly pdf) as a gentle/somewhat practical survey of category theory. It may end up being more math-y than you're looking for but it's also free on the internet, so worth taking a peek at.

fomo sacer fucked around with this message at 00:46 on Nov 19, 2016

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
Elm seems to be getting better and better at getting rid of everything that I like about it.

xtal
Jan 9, 2011

by Fluffdaddy
Elm is great if you like enduring the horrors of front-end web development and the horrors of learning a new gimped language that has no other purpose than the horrors of front-end web development at the same time

9-Volt Assault
Jan 27, 2007

Beter twee tetten in de hand dan tien op de vlucht.
so what is good way to do front-end web dev if you don't like JavaScript (besides not doing it at all :v: )? Purescript? Typescript? Some ocaml-to-js thing? React? Clojurescript?

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
None, front end is basically forsaken ground. Elm is the best we got, followed by React/Redux.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
If you like functional programming you might enjoy using React with Flux/Redux (persistent change tracking) and RxJS (FRP-ish). If you prefer Angular 2 you can have static types with TypeScript, and you can use RxJS and/or Redux there as well. Keep in mind that there are always a million alternatives to every library though. Webdev still kind of sucks but it's come a long way.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
GHCJS is getting better and better, and I've really enjoyed working with Reflex.

Also, there's now DWARF debugging support in stack HEAD.

Sinestro fucked around with this message at 00:35 on Nov 28, 2016

xtal
Jan 9, 2011

by Fluffdaddy

9-Volt Assault posted:

so what is good way to do front-end web dev if you don't like JavaScript (besides not doing it at all :v: )? Purescript? Typescript? Some ocaml-to-js thing? React? Clojurescript?

HTML, CSS and as little JavaScript as possible. If you're using React you've already lost the battle

Workaday Wizard
Oct 23, 2009

by Pragmatica

xtal posted:

Elm is great if you like enduring the horrors of front-end web development and the horrors of learning a new gimped language that has no other purpose than the horrors of front-end web development at the same time

Eh... it's not gimped that much v:shobon:v

xtal
Jan 9, 2011

by Fluffdaddy

Shinku ABOOKEN posted:

Eh... it's not gimped that much v:shobon:v

Does it still only run in browsers because building and learning a language just for front end web dev is straight up farcical

Like at least use blaze-react or whatever

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
Elm has a REPL, and has had one for a long time. Also, I'd say that the biggest problem with languages for front-end web dev up to now (Javascript) is that most general functionality is entirely useless for the task at hand, and a language specifically geared to making websites could be - and, in the case of Elm, is - much better.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



https://github.com/ElmCast/elm-node exists, but I imagine it'll be 'experimental' forever because there are already decent server-side (functional) languages.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

xtal posted:

Does it still only run in browsers because building and learning a language just for front end web dev is straight up farcical

Like at least use blaze-react or whatever

JS is straight up farcical, you're right

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



xtal posted:

HTML, CSS and as little JavaScript as possible. If you're using React you've already lost the battle

If your UI is trivial enough for that advice to work, I recommend giving up and using one of the drag-and-drop WYSIWYG site builder things because you don't have any problems they can't handle

xtal
Jan 9, 2011

by Fluffdaddy
99.999% of UIs are that trivial and if you think you're the exception you're probably wrong but knock yourself out

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

xtal posted:

Does it still only run in browsers because building and learning a language just for front end web dev is straight up farcical

Do you feel the same way about SQL ("building and learning a language just for relational databases is straight up farcical")?

xtal
Jan 9, 2011

by Fluffdaddy

NihilCredo posted:

Do you feel the same way about SQL ("building and learning a language just for relational databases is straight up farcical")?

That's pretty clearly apples-and-oranges. http://www.andl.org is straight up farcical and a better comparison

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



xtal posted:

99.999% of UIs are that trivial and if you think you're the exception you're probably wrong but knock yourself out

I don't entirely disagree - I think the percentage is somewhat lower depending on how you count, but the people who pay me sure do.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

xtal posted:

99.999% of UIs are that trivial and if you think you're the exception you're probably wrong but knock yourself out

The amount of contempt that you have for front end development shows that maybe you shouldn't be weighing in too heavily on it man.

kujeger
Feb 19, 2004

OH YES HA HA

Maluco Marinero posted:

The amount of contempt that you have for front end development shows that maybe you shouldn't be weighing in too heavily on it man.

to be fair, ten minutes on the internet is enough to drive most anyone to contempt

xtal
Jan 9, 2011

by Fluffdaddy
http://www.idris-lang.org/towards-version-1-0/

*starts countdown on uninstalling ghc*

kujeger posted:

to be fair, ten minutes on the internet is enough to drive most anyone to contempt

Ten years in this case. gently caress the web

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



kujeger posted:

to be fair, ten minutes on the internet is enough to drive most anyone to contempt

Because most sites are jenga stacks of Wordpress plugins and many if not most 'web developers' are idiot shitmonkeys who only know how to copy+paste poo poo from SO until something sort of works, but there are decent, well-made sites out there.

xtal posted:

http://www.idris-lang.org/towards-version-1-0/

*starts countdown on uninstalling ghc*


Ten years in this case. gently caress the web

quote:

A Language with Dependent Types

Titillating stuff

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
God, I can't wait for Idris 1.0. It's already a really good language, and I'm interested in the final steps they're taking to get it stable and ready for that milestone.

Replacing effects with states is something that might take some getting used to - effects was a much better alternative to MTL, so I wonder what states is going to do to improve upon that?

xtal
Jan 9, 2011

by Fluffdaddy

Asymmetrikon posted:

God, I can't wait for Idris 1.0. It's already a really good language, and I'm interested in the final steps they're taking to get it stable and ready for that milestone.

Replacing effects with states is something that might take some getting used to - effects was a much better alternative to MTL, so I wonder what states is going to do to improve upon that?

I would be using Idris already if it had a package manager

gonadic io
Feb 16, 2011

>>=

xtal posted:

I would be using Idris already if it had a package manager

Well you know what to do! Every language needs a bespoke plugin manager where the config files are a subset of the language itself.

xtal
Jan 9, 2011

by Fluffdaddy
What we need to do is make Nix not suck, then this problem will be permanently solved

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

gonadic io posted:

Well you know what to do! Every language needs a bespoke plugin manager where the config files are a subset of the language itself.

Now I'm wondering how dependent types would effect the expression of packages. Maybe you could have a function

code:
package : String -> Nat -> Type
and to successfully compile, the package manager would provide a proof of that type (the downloaded package)? So the total program proof would rely on the proofs of each of the
packages, which is a version downloaded that matches the specification. You could replace the Nat with a more relaxed bound, perhaps some kind of Version type.

...on second thought, maybe someone can just make a Maven plugin for this stuff. Or just use Nix.

Athas
Aug 6, 2007

fuck that joker
Does Idris produce decently efficient code nowadays? Does it have arrays? I remember that it was supposed to be more practical than Agda, but I also heard someone claim that runtime efficiency had gotten derailed a bit along the way. I don't know what to believe anymore!

xtal
Jan 9, 2011

by Fluffdaddy

Athas posted:

Does Idris produce decently efficient code nowadays? Does it have arrays? I remember that it was supposed to be more practical than Agda, but I also heard someone claim that runtime efficiency had gotten derailed a bit along the way. I don't know what to believe anymore!

It's decently efficient. Performance is, by their admittance, not a priority. You can generate more than just C, though. JavaScript, CLR, JVM and LLVM backends are under development by third-parties.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

app : Vect n a -> Vect m a -> Vect (n + m) a

Is this a sort of thing we can expect in Haskell?

xtal
Jan 9, 2011

by Fluffdaddy

Jarl posted:

app : Vect n a -> Vect m a -> Vect (n + m) a

Is this a sort of thing we can expect in Haskell?

Yes, but not any time soon, and it will probably happen through ugly, arcane language extensions.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


xtal posted:

What we need to do is make Nix not suck, then this problem will be permanently solved

I was going to say that nix is already good, but then I remembered how much trouble people seem to have with git, and I admit it's not as good as git.

But really, everyone, please use nix.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

Jarl posted:

Is this a sort of thing we can expect in Haskell?

You can kind of hack this into Haskell at the moment - if you use the DataKinds language feature, you can get type-level Nats (and other inductive types), which can be used in those kind of type definitions (see this article for more). It's very limited, though.

Athas
Aug 6, 2007

fuck that joker

Asymmetrikon posted:

You can kind of hack this into Haskell at the moment - if you use the DataKinds language feature, you can get type-level Nats (and other inductive types), which can be used in those kind of type definitions (see this article for more). It's very limited, though.

My experience is that it is terrible to use in practice. As an experiment, I had a module in my compiler that I decided to implement using all this type-level magic. While I got it to work, I ended up spending a ton of time proving arithmetic identities (like x+(y-z)=(x+y)-z) to satisfy the type checker. This is also a serious PITA in real dependently typed languages, but they generally have tooling to generate trivial but tedious proofs. I have since replaced it with dynamic checks that fail if my desired invariants are invalidated. Works fine and is much easier to understand and modify.

xtal
Jan 9, 2011

by Fluffdaddy

Doc Hawkins posted:

I was going to say that nix is already good, but then I remembered how much trouble people seem to have with git, and I admit it's not as good as git.

But really, everyone, please use nix.

code:
{
  config.language.quality = poo poo;
}
Maybe Guix solves this?

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Oh, if that's the part that bothers you, then guix uses guile, feel free to use and promote that instead. I care more about spreading functional package management in general, independent of interface. Personally, with Nix-the-language, I've finally reached my usual functional language plateau of ignorant competence where I can write some, and understand most that I read, but not form a useful critique about what should be different.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Nix is absolutely glorious, especially for software development, since it makes it very easy to maintain (and share!) a wide variety of different build environments with predictable versions of dependencies and tools available. Also for servers because it's a lot easier to fix/update a system that you haven't touched in two years if the entire system is described by a short stateless config file.

The language isn't great, but it's good enough. I'll take some idiosyncratic syntax over stateful package management any day.

xtal posted:

It's decently efficient. Performance is, by their admittance, not a priority. You can generate more than just C, though. JavaScript, CLR, JVM and LLVM backends are under development by third-parties.
I developed the LLVM backend from 2013 through 2014. Unless there's a new repository or unrelated effort I'm unaware of, it has been unmaintained ever since. I moved on because I was sick of spending all my free time on a tooling project nobody else used, and because it was impossible to get edwinb to discuss making it officially supported, despite significant performance and portability benefits. I don't think he was interested, at least at the time, in having an officially supported backend that wasn't a stack machine (which is what the C code that the official backend emits behaves like). Never made a lot of sense to me; translating a lambda calculus to SSA form is very intuitive :shrug:

That said, dependent types are absolutely glorious and everyone should be very excited about them becoming more accessible. I'm optimistic that Haskell will eventually provide them in a non-awkward way (it's been going that direction for a while), but what I really dream of is Rust someday getting there. Writing arithmetic proofs can be annoying, but real-world code is full of issues arising from people getting simple arithmetic wrong, so it doesn't really seem gratuitous.

Adbot
ADBOT LOVES YOU

Workaday Wizard
Oct 23, 2009

by Pragmatica
Genuine question: What's the real world utility of dependent types?

  • Locked thread