Live data from Hacker News

Learn You an Agda

williamdemeo.github.io

21–30 of 72 posts

Re: Learn You an Agda

#21
post #9

Languages that use types for elaborate proofs always seem to me like they only prove the most uninteresting properties of programs, namely the parts that deal with data transformations. Not that data transformations aren't important, but the properties they need to preserve are usually easy to be convinced of without any assistance by the compiler. At the end of the day, programs are written for their side effects (u…

Sounds like you are interested in applications of temporal logic for formal verification in software development, which is an area of active research. Prof. David Harel works in that field: http://www.wisdom.weizmann.ac.il/~harel/papers.html Do an in-page search for terms like temporal , behavioral , scenario , LSC , live sequence . By the way, I'm no expert but am interested in similar applications.

I'm actually about to integrate some aspects of behavioral programming in a concurrency library I'm maintaining. I also vaguely recall taking a class with Prof. Harel many years ago...

Re: Learn You an Agda

#22
post #17
post #9

Languages that use types for elaborate proofs always seem to me like they only prove the most uninteresting properties of programs, namely the parts that deal with data transformations. Not that data transformations aren't important, but the properties they need to preserve are usually easy to be convinced of without any assistance by the compiler. At the end of the day, programs are written for their side effects (u…

Given formal semantics of your programming language and some time, I think you can use Agda to prove interesting properties about correct programs you write in that language. Semantics, the behaviour of objects such as sockets, can be encoded in types the theorem prover can understand. It can look like this for a basic imperative language: https://github.com/Twey/imp-agda/blob/master/IMP/Semantics/O... . You can then…

[deleted]

Re: Learn You an Agda

#23
post #9

Languages that use types for elaborate proofs always seem to me like they only prove the most uninteresting properties of programs, namely the parts that deal with data transformations. Not that data transformations aren't important, but the properties they need to preserve are usually easy to be convinced of without any assistance by the compiler. At the end of the day, programs are written for their side effects (u…

> Languages that use types for elaborate proofs always seem to me like they only prove the most uninteresting properties of programs, namely the parts that deal with data transformations. You can proof almost anything in agda. Even the most complicated mathematical theorems. >What I'm most interested in is proofs that, say, in a concurrent environment, a function that closes a socket will never be called as long as t…

>You can proof almost anything in agda. Even the most complicated mathematical theorems.

And I think that's the thing that makes Agda interesting. If you limit Agda to proving things about computer programs, it doesn't sound that special. People are using Agda to prove things about, for example, topology.

Re: Learn You an Agda

#25
post #14

Earlier quoted context omitted.

On top of the pictures, the examples are a lot more fun than foo and bar. Here's (part of) how Learn You a Haskell introduces map: ghci> map (++ "!") ["BIFF", "BANG", "POW"] ["BIFF!","BANG!","POW!"]

I hate foo/bar for some reason. I think it's because it is supposed to be "this is just whatever", and yet they force me to think about Kung Fu, the Foo Fighters and crowbars.

I just think of a certain audio player...

Re: Learn You an Agda

#26
If I wrote a natural number calculator in Agda; would all my numbers be represented as lists of successions from zero or can the compiler convert them to two's-complement integers as we know and love them?

In case the compiler can do that conversion: is it is programmed to do that for some subset of numeric types or can it infer an optimal binary representation of a value somehow?

On the other hand, if they really were represented as lists then I presume this language is intended as purely academic work and has no application in a production environment. Am I wrong?

Re: Learn You an Agda

#27
post #12

I like to show you the immense beauty of the Agda standard library: http://agda.github.io/agda-stdlib/html/README.html (all clickable and…you'd better have proper unicode fonts).

Even something as mundane as Data.Bool is beautiful, defining False in terms of bottom. I love to look at unicode, but is it a pain to type it in practice, even given emacs?

I don’t use Agda, but for most mathy Unicode input, I use C-\ (toggle-input-method) and choose TeX mode. Then you can type “\forall\alpha. \alpha \to \alpha” and get back “∀α. α → α”, which is pretty good. There is also C-x 8 RET if you want to type a particular Unicode character by name or code point number.

Re: Learn You an Agda

#29
post #24

Is there any reason to use Agda over Coq or vice versa?

http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AgdaVs...

You might also want to compare to Idris (and maybe Epigram, but its no longer in development).

http://www.quora.com/How-does-Idris-compare-to-other-depende...

http://www.reddit.com/r/haskell/comments/132kg0/agda_epigram...

http://www.reddit.com/r/dependent_types/comments/q8n2q/agda_...

http://stackoverflow.com/questions/9472488/differences-betwe...

All have pros and cons; i like that Idris can compile to JS (https://raichoo.github.io/posts/2014-01-28-improved.html)

Re: Learn You an Agda

#30

If I wrote a natural number calculator in Agda; would all my numbers be represented as lists of successions from zero or can the compiler convert them to two's-complement integers as we know and love them? In case the compiler can do that conversion: is it is programmed to do that for some subset of numeric types or can it infer an optimal binary representation of a value somehow? On the other hand, if they really we…

It's a proof assistant. Not really something you use for number crunching, industry or not.
Post reply on HN