MacQueen, and only on alternating weeks.
02:26:24
I will never forget.
02:26:30 the looks better
02:26:42 ksf: indeed, there are really simple template idioms i'd like
to use that are socially unacceptable because of the verbosity that occurs
without inferencing (c++0x's auto will help that somewhat)
02:26:46 @flush
02:26:55 @remember JonathanShapiro Later we would come to feel that
monads do not scale to large programs well.
02:26:55 Done.
02:27:00 @quote scale
02:27:00 JonathanShapiro says: Later we would come to feel that
monads do not scale to large programs well.
02:27:33 @flush
02:27:52 ' The problems with module systems in stateful languages are
all about global variable initialization order. Java ducks this by eliminating
both non-trivial and mutable global variables. Which works, but it is one of the
reasons that Java isn't terribly well suited to systems programming. One thing
does seem clear: using things before you define them is problematic in a safe
programming language.
02:28:11 (Yes, I suppose using undefined things can be problematic)
02:28:46 java isn't suited for systems programming because it's without a
j2se runtime
02:29:01 insert a "a pain to use" there.
02:29:13 i know, i did games in j2me.
02:29:29 ACTION proposes hardware j2se runtime chips
02:29:48 ACTION proposes software j2se compile-time chips
02:29:55 you've got the speed of an interpreted language and the
inflexibility of a compiled one.
02:30:32 ksf, how dare you say such blasphemy to a compiled channel!
02:31:13 ghc-api ftw.
02:31:23 @faq Can Haskell be as flexible as an interpreted language?
02:31:23 The answer is: Yes! Haskell can do that.
02:31:30 'From the programming language community, we are often informed
that we didn't fully understand the I/O monad, or we are asked whether state is
truly necessary. To some degree this question is a matter of theology, but state
is unquestionably awkward from a verification standpoint. '
02:31:47 TH ftw.
02:32:57 gwern, this is from the recent LtU paper?
02:32:58 'The real reason we stuck with the LISP-ish syntax is that we
didn't want to be fiddling with the parser while designing the language, and (to
a lesser degree) because we didn't want to encourage programmers until we
thought the language was ready. We are now preparing a more sensible surface
syntax, whereupon we will receive rotten egg and tomato complaints from the LISP
community. You can't please everyone.'
02:33:09 luqui: I don't think so, the page is marked a draft/unfinished
02:33:10 gwern: heh, "So in summary, why did we create BitC? It seems
that we did so because of a failure to understand functional programming idioms."
02:33:23 (not a real quote)
02:33:24 heh
02:33:47 Yes, it's the LtU paper.
02:33:50 @remember JonathanShapiro We are now preparing a more sensible
surface syntax, whereupon we will receive rotten egg and tomato complaints from
the LISP community.
02:33:50 I will never forget.
02:33:55 @quote rotten
02:33:56 JonathanShapiro says: We are now preparing a more sensible
surface syntax, whereupon we will receive rotten egg and tomato complaints from
the LISP community.
02:34:37 starting out with lisp syntax is actually a very sensible idea.
02:34:49 ksf: Indeed it is.
02:34:51 Cale, that does seem a pretty common reason (with various
substitutions for "functional programming") to create a language
02:34:52 'It is noteworthy that none of this effort was deemed fundable
by the National Science Foundation (which is to say: by the academic programming
languages community). The work is clearly innovative, and it is somewhat unusual
to find a project of this sort that is accompanied by a validating experiment. '
<-- sour much?
02:35:07 ksf: lisp no-syntax
02:35:14 gwern, got a link?
02:35:22 ?seen mbeddoe
02:35:22 Last time I saw mbeddoe was when I left #debian-es, #dreamlinux-es,
#friendly-coders, #gentoo-uy, #haskell, #haskell-hac07, #haskell.de, #haskell.dut,
#haskell.es, #haskell.fi, #haskell.fr, #haskell.
02:35:22 hr, #haskell.it, #haskell.jp, #haskell.no, #haskell.ru, #haskell.se,
#haskell_ru and #thunks 2m 17d 21h 10m 27s ago.
02:35:23 luqui: looks like it might be post-LtU: 'We have received
comments, encouragement, and assistance from the many members of the bitc-lang
mailing list and the Lambda the Ultimate blog. '
02:35:35 dibblego: I posted it earlier: http://www.bitc-lang.org/docs/bitc/bitc-origins.html
02:35:36 Title: The Origins of the BitC Programming Language
02:35:57 'This sort of ``let's do a conservative, evaluable experiment''
approach makes project funding nearly impossible to obtain in academic circles,
which may help to explain why computer scientists tend to step on each other's
toes rather than standing on each other's shoulders. '
02:35:58 LISP has syntax. After all, lisp programs are not infinite...
02:36:31 @remember JonathanShapiro This sort of "let's do a conservative,
evaluable experiment" approach makes project funding nearly impossible to obtain
in academic circles, which may help to explain why computer scientists tend to
step on each other's toes rather than standing on each other's shoulders.
02:36:32 Okay.
02:36:37 @quote shoulders
02:36:38 JonathanShapiro says: This sort of "let's do a conservative,
evaluable experiment" approach makes project funding nearly impossible to obtain
in academic circles, which may help to explain why
02:36:38 computer scientists tend to step on each other's toes
rather than standing on each other's shoulders.
02:37:18 ACTION notes quietly that there's a tense disagreement there -
'tend to step' doesn't parallel 'standing'
02:38:09 minor type error
02:38:35 classical confusion of cause and effect there.
02:38:37 isn't it really awesome that creating your own operators in
Haskell is much more elegant and completely non-brittle?
02:38:52 well, it's not perfect
02:38:55 I mean, most language I know that let you do this result in very
brittle code.
02:39:11 I still find '-4' to be strange, and I wonder why precedences
are ints
02:39:29 what else should they be?
02:39:35 gwern: isn't the alternative a partial ordering?
02:39:37 dcoutts: little experiment, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/statistics-fusion-0.1
(reimplementing hstats using uvector fusion)
02:39:38 Title: HackageDB: statistics-fusion-0.1, http://tinyurl.com/667zvf
02:39:45 fynn, dependencies.
02:39:50 fynn: well, reals. or an approximation
02:39:56 gwern: strings
02:40:02 like * > +
02:40:08 hey, awesome, haddock generates uvector's docs now.
02:40:15 possibly the reason for them being integers and discrete is to
avoid confusing people too much.
02:40:22 fynn: if '+' is 8, and '*' is 9, one should be able to insert
something between '+' and '*' if that's semantically appropriate
02:40:25 it's hard to remember precedence rules as it is.
02:40:45 8.5 would work. and suppose you want to add another betwene the
new one and *? make it 8.75 and so on
02:40:58 Stuff like * > + means you have to worry about cycles and such.
02:41:05 * > # > + still holds.
02:41:11 gwern: still, isn't Haskell the language with the best (maybe "only
usable") implementation of "define your own operators"?
02:41:16 mauke: how would strings work?
02:41:17 well cycles are obviously errors.
02:41:32 ?users
02:41:32 Maximum users seen in #haskell: 559, currently: 492 (88.0%),
active: 23 (4.7%)
02:41:34 fynn: I suspect the lispers would disagree. haskell is
certainly better than your average bear I do admit
02:41:54 gwern: I don't know, but the idea was mentioned in the perl6
design :-)
02:42:04 gwern: you think lispers would argue that non-hygienic macros
are not brittle?
02:42:09 mauke: of course, I suppose
02:42:18 dons: I'm interested what you think is gained from hitting
mean etc with the INLINE hammer :-)
02:42:22 fynn: I dunno. go ask some common lispers and see what they say
02:42:25 dcoutts: it is required.
02:42:28 mauke, only briefly.
02:42:32 dcoutts: otherwise no fusion happens in the user's module.
02:42:37 hmm
02:42:41 ghc 6.10
02:42:47 mauke, every day
02:42:53 dcoutts: note i had to /remove/ inline from Data.Binary.Get to
get it to inline...
02:42:54 because the bodies look too big
02:43:00 maybe, yeah.
02:43:15 gwern: I worked with Lisp a bit, and although the non-hygienic
macros are powerful, I'm pretty sure they're more brittle than defining
operators in Haskell.
02:43:33 the breakage cases are much more subtle, and problematic once
they occur.
02:43:38 dons: hmm, do you know what was going on with get? phasing
things? inlining too early?
02:43:46 fynn, of course, because they are not extensional
02:43:46 fynn: iirc, wouldn't a lisper hack the symbol table to define
an operator?
02:44:03 (man, am I hungry)
02:44:10 lol
02:44:32 (fullp fridge)
02:44:41 any mechanism which can distinguish between two identical
functions is going to be brittle
02:44:43 hehe
02:45:13 gwern: I thought it was 'hack the gibson' not symboltable
02:45:41 .oO( what's the equivalent of %::=() in lisp? )
02:46:06 dcoutts: it wasn't respecting our inline stuff. not sure why.
02:46:43 mauke, I have been out of perl for a while, but... that isn't
legal, is it?
02:46:45 gwern: (really not sure changing the symbol table in any way is
going to give you all the stuff you can do with Haskell's custom operators)
02:46:56 luqui: depends on your definition of "legal"
02:47:16 mauke, okay, probably it will parse, but no matter what the
context, it will always result in a runtime error
02:47:22 nope
02:47:32 % perl -wle '%::=(); print 42'
02:47:32 42
02:47:43 .oO( does stripping a lisp program of identifiers produce
interesting set-theoretic theorems? )
02:47:43 oh geez.
02:47:50 the Enterprise operator.
02:48:03 luqui: but do it in a BEGIN block to trigger a segfault
02:48:03 Perl 6 code is going to look like a Star Trek episode.
02:48:25 oh that's a real =. I was parsing "%::=" as the name of a hash
02:48:48 i see, empty the top-level symbol table
02:48:55 We call it operator NCC-1701?
02:50:01 omg my code typechecks!
02:50:08 ACTION does the typechecking dance
02:50:09 congrats
02:50:09 byorgey: yeah?
02:50:13 ship it!
02:50:20 byorgey: now, exlpain the significance
02:50:24 ACTION hits the 'ship' button
02:50:27 Is the type 'IO a' really 'World -> (a, World)'?
02:50:32 byorgey: what is your code?
02:50:35 harblcat: no
02:50:40 well, I've just finished some major refactoring
02:50:50 I basically spent the past two hours fixing type errors
02:50:50 harblcat: more like (a, World)
02:51:04 so I had to share my victory =)
02:51:14 this is my lambda-cube interpreter
02:51:30 byorgey: tell me about it...I had some sessions on the darcs
source were I'd spend a couple days making stuff type check with our GADTs :)
02:51:35 harblcat, that depends on what you mean by "really"
02:51:41 hehe, sounds fun =)
02:51:46 mauke: I've been trying to get the 'a' out..
02:51:51 where a day is defined as 12+ hoours of hacking :
02:51:52 :)
02:51:54 harblcat: why?
02:52:13 harblcat, you can't, by design. though you can use the a inside
another IO action
02:52:14 ACTION is determined but perhaps slow
02:52:15 harblcat: It's not *really* World -> (a,World)
02:52:31 mauke: So that I don't have a whole bunch of IO * functions...
02:52:38 huh?
02:52:44 Working with random numbers is hard.
02:52:55 if you use global state, yes
02:52:56 harblcat, make them functions of an infinite list of random
numbers
02:52:57 or rather, no
02:53:03 just use IO everywhere
02:53:04 harblcat: well, you see, you have an inverted view of the world
as most haskell beginners do
02:53:17 harblcat: Inside of a do-block defining an IO action, you can
write v <- x where x :: IO t, and then v :: t
02:53:22 lispy: I am a beginner, yes.
02:53:36 harblcat: That v can then be passed on to a pure function.
02:53:40 lispy: everyone knows that if you try to hack a gibson, you'll
just wind up burning the chrome
02:53:41 ACTION just defined the shurikan operator: <+>
02:53:50 Cale: But then when I return v, it's IO v, anyway
02:53:51 apropos "hacking the Gibson" that is.
02:53:51 harblcat: and the result perhaps used for output later
02:53:55 harblcat: right.
02:54:00 > randoms (mkStdGen 42)
02:54:01 [-3907187990116499535,-2519438828217931933,-8264534369199619667,86887135830...
02:54:05 harblcat: basically, you pull the value out while your in a do-block
and use all your non IO functions on that value. When you're done looking at the
value, you use 'return' to put it back into IO :)
02:54:07 > randoms (mkStdGen 42) :: [Double]
02:54:08 [0.11040701265689151,0.8453984927258916,0.30778213446209723,0.7813880826070...
02:54:16 harblcat: Do something pure with the thing you got from the IO
action, and then do some output
02:54:22 "Type mismatch: expected type A -> A, got type A -> A instead"
-- hmm... =P
02:54:28 harblcat: At least, that's the general pattern.
02:54:31 ACTION goes and watches an Alan Kay presentation at TED
02:54:38 harblcat: In the end, your 'main' is an IO action anyway.
02:54:52 byorgey: oh, better do a recall on that ship :)
02:55:00 too late! ;)
02:55:19 Ah, so the value is pure while in the do block, but once it
leaves, it's an IO value again?
02:55:19 byorgey: at least your program doesn't allow buggy programs :)
02:55:31 harblcat: yeah, in that regard IO is a wrapper
02:55:32 harblcat: the do-block as a whole is an IO action.
02:55:46 lispy: I wouldn't be willing to put money on that...
02:55:46 I see. So I've got to think differently.
02:56:00 harblcat, well.. it can only leave through the use of "return",
which has type a -> IO a, which puts it back into the IO monad
02:56:01 Think different!в„ў
02:56:07 'leave'
02:56:10 byorgey: obama won, we can do anything now. Don't be so shy ;)
02:56:16 hehe
02:56:16 I'm not clear on what 'leave' means here ;)
02:56:31 ?faq Can Haskell elect an african american president to the US?
02:56:31 The answer is: Yes! Haskell can do that.
02:56:41 Cale, me neither. I'm just trying to jump on his thought train....
02:56:44 But you might pass v to a pure function.
02:56:54 something like...
02:57:02 let w = f v
02:57:20 and then do some more actual I/O with the result of that...
02:57:23 print w
02:57:49 Ah.
02:58:18 Well, someone said before, generating a list of randoms is
not hard. I was just getting confused as to how I would use them.
02:58:24 harblcat, but if the only IO you are doing most of the time is
getting random numbers, you might like MonadRandom on hackage
02:58:47 harblcat: now that we've said all that, there is one way to
take a value out of IO but it's reserved for use by experts that understand it
will eat kittens if used incorrectly
02:59:02 ACTION eats a kitten
02:59:16 I think it's misleading to say "take a value out of IO"
02:59:19 Assuming I completely abandon operational reasoning, can I still
reason about big-O?
02:59:27 A better way to say that is "run an IO action"
02:59:33 I was making a list of numbers, basically rands n, which
would return IO [Int]... And sum doesn't work on IO [Int]
02:59:35 ksf, VERY good question.
02:59:45 harblcat: fmap sum does though.
02:59:53 :t fmap sum
02:59:54 forall a (f :: * -> *). (Functor f, Num a) => f [a] -> f a
03:00:00 ksf, I have been trying to answer it for myself for quite a
while
03:00:02 :t fmap sum :: IO Int
03:00:04 Couldn't match expected type `IO Int'
03:00:04 against inferred type `f [a] -> f a'
03:00:09 harblcat: It gives you an IO Int
03:00:23 :t fmap sum (replicateM 6 randomIO)
03:00:24 forall a. (Random a, Num a) => IO a
03:00:29 :t fmap sum :: IO [Int] -> IO Int
03:00:30 IO [Int] -> IO Int
03:00:50 (boy, Kay seems very tired in his talk. when I think about it,
he must be in his 60s by now or something)
03:00:51 harblcat: Of course, you could also write:
03:01:00 :t fmap sum
03:01:01 forall a (f :: * -> *). (Functor f, Num a) => f [a] -> f a
03:01:07 do xs <- myIOaction; return (sum xs)
03:01:29 :t do xs <- replicateM 6 randomIO; return (sum xs)
03:01:31 forall a. (Num a, Random a) => IO a
03:01:38 How to be sure that map is really O(n) and not NP-hard?
03:01:48 ksf: what?
03:02:00 Assuming I completely abandon operational reasoning, can I
still reason about big-O?
03:02:10 no, you can't.
03:02:24 that's quite a conclusion to jump to
03:02:29 If you're working in the land of denotational semantics,
functions don't take any time at all.
03:02:35 They're defined or they're not.
03:02:51 yeah. evaluation strategies alone would mess things up
03:02:55 but saying "no, you can't" I think is a shaky thing to extract