code logs -> 2013 -> Sat, 24 Aug 2013< code.20130823.log - code.20130825.log >
--- Log opened Sat Aug 24 00:00:18 2013
00:00 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
00:00 mode/#code [+o himi] by ChanServ
00:00
< simon_>
RichyB, how does an LL(1) grammar verify that tags have corresponding closing tags in the right order to arbitrary depth?
00:01
< simon_>
RichyB, you need more than an LL(1) grammar, I think. HTML tag soup is LL(1).
00:02
< simon_>
RichyB, LL(1) and a stack, or LR(1) (which has a stack, so...)
00:02
< RichyB>
Oh yes. Hrmn. The fact that the tags have to match up looks problematic at first, like you might even need backreferencesâ¦
00:02
< simon_>
I wouldn't say that's necessary. but you can actually parse XML using regex+backrefs, I think.
00:02
< simon_>
it's crazy, though.
00:02
< RichyB>
â¦but actually, they only match up in pairs, which is pretty easy.
00:03
< simon_>
no, wait. you need PCRE's recursion stuff too
00:03
< simon_>
yes
00:03
<&McMartin>
Yeah, you'd just do "type checking" when parsing the close tags
00:03
< RichyB>
You can very easily augment LL(1) with a stack because it never backtracks.
00:03
< simon_>
so you just need a stack and check that whenever a tag ends, it's the one on top of the stack.
00:03
< simon_>
RichyB, yes.
00:04
< RichyB>
Haskell's Parsec is LL(unbounded) for pretty much precisely this reason
00:04 * simon_ is taking a course called Semantics and Types this fall...
00:04
< RichyB>
it's a Monad instance that implements LL parsing and also implements the State monad too on the side because that's useful to have lying around for things like symbol tables.
00:05 * simon_ has recently started using Reader monads for keeping lexically scoped symbol tables.
00:08
< RichyB>
You can think of State as a Reader that you can update, and the updated state will be visible to all subsequent actions in the same computation.
00:32 Syka [the@Nightstar-e0f5fd20.iinet.net.au] has quit [Connection closed]
00:40
< simon_>
RichyB, still around?
00:42
< RichyB>
Indeed.
00:43
< RichyB>
I just accidentally made the internet worse for myself by watching http://vooza.com/videos/radimparency/ and, halfway through, wondering, "Wait, what the heck is 'Grindr'?", googling it, and now I'm probably going to get different adverts on the internet than I used to get. :|
00:45
< simon_>
I've seen that.
00:45
< simon_>
I'm trying to figure out how to use GeneralizedNewtypeDeriving on my (very small) stack of monad transformers: https://gist.github.com/sshine/652cbf8df87a9759f3ee
00:46
< simon_>
unfortunately I get an error related to not using my deconstructor, runCodeGen
00:46
< simon_>
(error present at bottom)
00:47
< RichyB>
I have no idea how to use GeneralizedNewtypeDeriving (or even a clear idea of what it does), sorry.
00:48
< simon_>
oh, ok
00:49
< RichyB>
It's one of a few GHC extensions that I avoid on purpose because it opens holes in the type system. http://joyoftypes.blogspot.co.uk/2012/08/generalizednewtypederiving-is.html
00:50
< simon_>
when you make a monad transformer stack, you end up with the problem that all those neat get/put/modify/local/etc. monadic actions that applied to individual components of the stack don't work for your new type, and you have to write a bunch of boilerplate code so WhateverNewType can be viewed as a state-monad by lifting the 'get' action to the proper level in the stack.
00:51
< simon_>
s/(?<=the 'get' action)/e.g. /
00:52 You're now known as TheWatcher[T-2]
00:52
< simon_>
then I can do 'get' as if this were just a state-monad, and 'local' as if it were just a reader-monad, when in fact I make this happen by declaring my newtype an instance of MonadState and having its get/etc. replaced by some wrapper function that handles the complexity I add to the type.
00:52
< simon_>
e.g. 'get' becomes 'lift get', etc.
00:53
< simon_>
instead of writing all these instances myself, GeneralizedNewtypeDeriving will let me specify which sub-parts of my type are to be treated as the state of the state-monad, and so on for all the other monad transformers.
00:54
< simon_>
I made a little exercise for myself to add all these instances manually just to get a grasp of what magic GHC is doing for me.
00:54
< RichyB>
Oh.
00:54
< RichyB>
Your problem here is that you wrote "evalStateT (translateProg ... ...)" when you meant to write "evalState (runCodeGen (translateProg ... ...))"
00:55
< simon_>
and yeah, I did read that blog post you linked to... I'm not sure I like it yet. but the people who've taught me Haskell use it all the time for similar purposes, so...
00:55
< RichyB>
Yeah, just don't use it in the presence of type-level witnesses or anything.
00:55
< simon_>
dangit! you're right. I kept trying add runCodeGen to the outside of those calls.
00:55
< simon_>
hehe
00:56
< simon_>
I don't know what a type-level witness is yet, but our ICFP team name was "Type Witness Protection Programme"
00:56
< RichyB>
This is a perfectly boring case of - newtypes needing to be wrapped and unwrapped - even though the wrap and unwrap operations are (AIUI) always no-ops and get compiled to nothing.
00:56
< simon_>
yup
00:56
< simon_>
somehow I can't distinguish top from bottom in these monad transformer stacks.
00:58
< simon_>
apparently you lift from the inside out, the top of the stack is the outermost(?) transformer,
00:58
< simon_>
thanks, RichyB.
00:59 * simon_ is translating to a reversible architecture on which register allocation isn't solved yet.
00:59
< RichyB>
No trouble. Just the kind of thing that takes two pairs of eyes to stop.
00:59
< RichyB>
Oh Hell, good luck with that. :)
01:03 You're now known as TheWatcher[zZzZ]
01:04
< RichyB>
simon_, eh, I'd go on continuing with -XGeneralizedNewtypeDeriving. If you're not using type familier or GADTs then I don't think it's likely that you'll accidentally implement unsafeCoerce with it. ;)
01:04
< simon_>
right :)
01:04
< simon_>
I haven't really started using type families.
01:07 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.]
01:10 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code
01:10
< RichyB>
Oh interesting
01:10
< RichyB>
They fixed the segfault bugs that GND used to enable by adding one more type of types to the type-checker. :)
01:11
< RichyB>
http://ghc.haskell.org/trac/ghc/ticket/7148
01:11
< RichyB>
Paper linked from here -> http://ghc.haskell.org/trac/ghc/wiki/Roles
01:11
< RichyB>
So the problem "I can accidentally violate another module's invariants" is still there but the "I can accidentally write unsafeCoerce" isn't.
01:12
< simon_>
oh
01:13
< simon_>
when I was writing my bachelor's project, a friend was doing his at the same time on x86 code obfuscation. he wrote an obfuscator which was essentially a bijective function that did a lot of weird jumping around, encrypting things. at his defense, he said that the best way to obfuscate your code is still writing it in Haskell.
01:14
< RichyB>
ahahahaha no
01:14
< RichyB>
Write it in Haskell's type-checker instead. ;)
01:14
< simon_>
right :)
01:14
< simon_>
my TA did extend it with Peano arithmetic once :)
01:15
< RichyB>
Haskell is also much simpler (to me, at least) than, say, Coq.
01:17
< simon_>
I haven't looked into dependent types yet.
01:18 * simon_ reads http://research.microsoft.com/en-us/um/people/simonpj/papers/assoc-types/fun-wit h-type-funs/typefun.pdf
01:18 Derakon is now known as Derakon[AFK]
01:19
< RichyB>
Yyyyes
01:20
< RichyB>
fundeps let you encode functions in the type system
01:20
< RichyB>
argh for fuck's sake the internet is so fucking useless
01:20 * simon_ has in the last month gotten addicted to Hacker News and has to say yes.
01:21
< RichyB>
*the web
01:27
< RichyB>
I may have hallucinated it, but I think I remember reading at some point about a Lisp implementation that compiled to Haskell typechecker code.
01:27
< RichyB>
Bah.
01:36 Turaiel[Offline] [Brandon@Nightstar-949d7402.resnet.mtu.edu] has joined #code
01:36 Turaiel[Offline] is now known as Turaiel
02:14 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
02:31 Vorntastic [Vorn@Nightstar-70ca46e4.sub-70-211-9.myvzw.com] has joined #code
03:25 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Client closed the connection]
03:26 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
03:31 ktemkin is now known as ktemkin[awol]
03:33 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Client closed the connection]
03:33 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
03:37 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Client closed the connection]
03:51 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:51 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:51 Vorntastic [Vorn@Nightstar-70ca46e4.sub-70-211-9.myvzw.com] has quit [[NS] Quit: Bye]
04:10 Kindamoody[zZz] is now known as Kindamoody
04:16 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
04:33 iospace [Alexandria@Nightstar-e67f9d08.com] has quit [Connection closed]
04:36 iospace [Alexandria@Nightstar-e67f9d08.com] has joined #code
04:36 mode/#code [+o iospace] by ChanServ
04:55 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Ping timeout: 121 seconds]
05:00 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
05:28 Turaiel is now known as Turaiel[Offline]
05:37 iospace [Alexandria@Nightstar-e67f9d08.com] has quit [Connection closed]
05:40 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
05:41 iospace [Alexandria@Nightstar-e67f9d08.com] has joined #code
05:41 mode/#code [+o iospace] by ChanServ
06:02 Karono [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Client closed the connection]
06:02 Karono_ [Karono@Nightstar-13c26ed9.optusnet.com.au] has joined #code
06:04 ErikMesoy|sleep is now known as ErikMesoy
06:20 Karono_ [Karono@Nightstar-13c26ed9.optusnet.com.au] has quit [Ping timeout: 121 seconds]
06:32 Karono [Karono@Nightstar-a97724cd.optusnet.com.au] has joined #code
06:53 Vornicus is now known as Vash
06:55 Vash is now known as Vornicus
07:07 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [Ping timeout: 121 seconds]
07:11 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
07:11 mode/#code [+o Alek] by ChanServ
07:11 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
07:47 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
07:47 mode/#code [+o himi] by ChanServ
07:49 Kindamoody is now known as Kindamoody|out
08:06 Netsplit *.net <-> *.split quits: @iospace, RichyB, @Pandemic, Chutzpah, Xires, @Zemyla, @Syloq, simon_, AnnoDomini, @froztbyte, (+14 more, use /NETSPLIT to show all of them)
08:07 Netsplit over, joins: RichyB, Chutzpah, @PinkFreud, @Tamber, @Reiv, &jerith, @Pandemic, @froztbyte, @iospace, &McMartin (+14 more)
08:26 VirusHome [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
08:26 Netsplit *.net <-> *.split quits: @Alek, @Namegduf, simon_, @Tamber, Xires, @Zemyla, @Pandemic, @Azash, Chutzpah
08:26 Netsplit over, joins: Chutzpah, @Tamber, @Pandemic, @Namegduf, Xires, simon_, @Azash, @Zemyla
08:28 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
08:31 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
08:31 mode/#code [+o Alek] by ChanServ
09:03 Syka [the@Nightstar-250464d0.iinet.net.au] has joined #code
10:00 You're now known as TheWatcher
10:09 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
10:23 Syka_ [the@Nightstar-e02c231f.iinet.net.au] has joined #code
10:27 Syka [the@Nightstar-250464d0.iinet.net.au] has quit [Ping timeout: 121 seconds]
11:20 thalass [thalass@Nightstar-de48278f.bigpond.net.au] has joined #code
11:40 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving]
12:13 Typherix [Typherix@Nightstar-ea8fda76.lnngmi.sbcglobal.net] has quit [Operation timed out]
12:19 Typherix [Typherix@Nightstar-ea8fda76.lnngmi.sbcglobal.net] has joined #code
12:54 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
12:54 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [[NS] Quit: Moving!]
12:57 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
12:58 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
12:58 mode/#code [+qo Vornicus Vornicus] by ChanServ
13:30 Kindamoody|out is now known as Kindamoody
13:36 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
14:26 VirusJTG_ [VirusJTG@BAD19E.09A45B.582A63.5AE998] has joined #code
14:29 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
15:05 thalass [thalass@Nightstar-de48278f.bigpond.net.au] has quit [[NS] Quit: *floop*]
15:33 Kindamoody is now known as Kindamoody|afk
15:37 Karono [Karono@Nightstar-a97724cd.optusnet.com.au] has quit [[NS] Quit: nini]
16:22 Syka_ [the@Nightstar-e02c231f.iinet.net.au] has quit [Ping timeout: 121 seconds]
16:23 Syka [the@A6D346.0419D1.CCD1D2.871D30] has joined #code
16:46 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
16:48 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
16:48 mode/#code [+o Syloq] by ChanServ
17:27 VirusJTG__ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
17:30 VirusJTG_ [VirusJTG@BAD19E.09A45B.582A63.5AE998] has quit [Ping timeout: 121 seconds]
18:56 gnolam_ [lenin@Nightstar-f7705974.cust.bredbandsbolaget.se] has joined #code
18:56 gnolam is now known as NSGuest20067
18:56 gnolam_ is now known as gnolam
18:57 mode/#code [+o gnolam] by ChanServ
18:58 NSGuest20067 [lenin@Nightstar-f7705974.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
19:14 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
19:14 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has joined #code
19:14 mode/#code [+o celticminstrel] by ChanServ
19:45 ErikMesoy [Erik@Nightstar-0fb48670.80-203-17.nextgentel.com] has quit [Ping timeout: 121 seconds]
20:23 Kindamoody|afk is now known as Kindamoody
20:56 Derakon[AFK] is now known as Derakon
21:09 VirusJTG__ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
21:09 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
21:26 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Sat Aug 24 22:58:56 2013
--- Log opened Sat Aug 24 22:59:04 2013
22:59 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
22:59 Irssi: #code: Total of 36 nicks [16 ops, 0 halfops, 0 voices, 20 normal]
22:59 mode/#code [+o TheWatcher] by ChanServ
22:59 Irssi: Join to #code was synced in 38 secs
23:53
<@Azash>
http://i.imgur.com/vz0fKG9.png?1
--- Log closed Sun Aug 25 00:00:34 2013
code logs -> 2013 -> Sat, 24 Aug 2013< code.20130823.log - code.20130825.log >

[ Latest log file ]