Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,761 events total
2021-07-28 22:00:00 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
2021-07-28 22:00:04 <monochrom> To achieve what Knuth meant by literate programming (hint: if it were just comment-vs-code syntax, he would not go to the trouble to implement two programs, weave and tangle), people now have to say "bidirectional literate programming"
2021-07-28 22:00:23 <monochrom> Programmers keep doing this.
2021-07-28 22:01:27 <monochrom> Hungarian notation : "Hungarian notation" :: engineer : "engineer" :: literate programming :: "literate programming"
2021-07-28 22:03:35 <monochrom> euouae: I haven't done literate programming (the real one) for a long time. But when I did, I used Norman Ramsay's programs "noweave" and "notangle".
2021-07-28 22:04:11 <monochrom> I get to handwave it because I can point you to existing software. :)
2021-07-28 22:04:34 <hpc> my favorite is when programmers invent new words for nothing, like "eventually consistent" or "duck typing"
2021-07-28 22:04:55 <monochrom> But "notangle" is the program that emits code files you can then give to compilers.
2021-07-28 22:05:13 <monochrom> "noweave" is the one that emits TeX/LaTeX files.
2021-07-28 22:05:22 <monochrom> Similarly Knuth's weave and tangle.
2021-07-28 22:06:35 <euouae> That stuff is so cryptic
2021-07-28 22:06:43 <euouae> I'm reading the man page and it's almost nonsensical
2021-07-28 22:07:08 <monochrom> man pages are seldom tutorials.
2021-07-28 22:07:20 <euouae> well for one I can't even find it online
2021-07-28 22:07:26 × ukari quits (~ukari@user/ukari) (Remote host closed the connection)
2021-07-28 22:07:35 <monochrom> If you already know Knuth's idea of literate programming, then noweave and notangle make sense.
2021-07-28 22:07:39 × fluffyballoon quits (~fluffybal@pat-verona-h.epic.com) (Quit: Client closed)
2021-07-28 22:07:56 <monochrom> If you don't, perhaps don't worry about it for now.
2021-07-28 22:08:03 <euouae> O
2021-07-28 22:08:04 fluffyballoon joins (~fluffybal@pat-verona-h.epic.com)
2021-07-28 22:08:17 <euouae> I'd know the idea if there was a single coherent article/blog about it :P
2021-07-28 22:08:22 × dschrempf quits (~dominik@mobiledyn-185-69-244-184.mrsn.at) (Quit: WeeChat 3.2)
2021-07-28 22:08:24 <monochrom> But millenial bloggers can only brag and handwave, yes.
2021-07-28 22:08:33 ukari joins (~ukari@user/ukari)
2021-07-28 22:08:52 <monochrom> "coherent blog" is an oxymoron.
2021-07-28 22:09:21 <dolio> Does the wikipedia article explain it?
2021-07-28 22:09:27 <monochrom> Look for Knuth's original articles and papers. Screw bloggers.
2021-07-28 22:09:48 <monochrom> Yeah wikipedia has a high chance of being OK too.
2021-07-28 22:10:16 <dolio> Seems like it does, although I just read it, and never understood what advocates were on about prior.
2021-07-28 22:10:16 <monochrom> The blogosphere is a meta-level echo chamber of mediocrity.
2021-07-28 22:10:55 <dolio> E.G. one of the main things that would disqualify Literate Haskell is that you still have to put all your imports at the top.
2021-07-28 22:11:33 <monochrom> That would be my opinion, yes.
2021-07-28 22:12:05 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
2021-07-28 22:13:49 <dolio> I'm not really sure I buy the 'revolutionary' part either, though.
2021-07-28 22:14:37 × euouae quits (~euouae@user/euouae) (Quit: Client closed)
2021-07-28 22:14:48 <monochrom> True. I was excited when I learned it when I was young. But not to the point of calling it "revolutionary".
2021-07-28 22:14:48 <dolio> It seems way too optimistic about the underlying reasons why software is poorly documented.
2021-07-28 22:15:51 chris_ joins (~chris@81.96.113.213)
2021-07-28 22:15:51 × epolanski quits (uid312403@id-312403.brockwell.irccloud.com) (Quit: Connection closed for inactivity)
2021-07-28 22:16:00 <dolio> Using literate programming isn't going to make your programmers proofread the entire codebase every time they make a change to make sure everything is still coherent.
2021-07-28 22:16:08 <monochrom> Oh yeah, it's even more thankless work than the existing comment system.
2021-07-28 22:17:13 <monochrom> I certainly did it when only it was appropriate. I ran a programming contest and then posted my solution and explanation. That one was an excellent use case.
2021-07-28 22:17:39 <monochrom> But the program I wrote for my MSc project, haha why would anyone.
2021-07-28 22:18:49 euouae joins (~euouae@user/euouae)
2021-07-28 22:19:54 × chris_ quits (~chris@81.96.113.213) (Ping timeout: 240 seconds)
2021-07-28 22:23:36 <dolio> Yeah, I would guess that it turns out well because of how Knuth is writing the programs, and most programs aren't written that way (single author, writing something intended to be didactic).
2021-07-28 22:24:32 × agua quits (~agua@2804:14c:8793:8e2f:8dcb:5525:982:c9ab) (Ping timeout: 268 seconds)
2021-07-28 22:24:33 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
2021-07-28 22:24:33 <dolio> I can write (I think) great stuff like that in non-literate Haskell when it's my goal, but often it's not.
2021-07-28 22:25:59 <dolio> Sometimes I do it in Agda, and that has constraints on the order you can write definitions in.
2021-07-28 22:28:44 <sm> eww!
2021-07-28 22:28:48 <glguy> Couldn't we do literate programming just the same now as Knuth did then? It just wouldn't be .lhs files; we'd have to use the same kind of processing passes used before.
2021-07-28 22:29:50 × Null_A quits (~null_a@2601:645:8700:2290:7921:180d:4519:92d1) ()
2021-07-28 22:29:53 <sm> we certainly can
2021-07-28 22:29:56 <monochrom> Yeah just use Knuth's weave-tangle or Ramsay's nowave-notangle. Agnostic to languages.
2021-07-28 22:30:39 <monochrom> Why even invent lhs in the first place.
2021-07-28 22:31:03 <sm> org mode can do it too
2021-07-28 22:32:16 <sm> and https://leoeditor.com
2021-07-28 22:34:44 <sm> or I suppose just m4 if you want to really mess around
2021-07-28 22:37:34 × euouae quits (~euouae@user/euouae) (Ping timeout: 246 seconds)
2021-07-28 22:37:38 lavaman joins (~lavaman@98.38.249.169)
2021-07-28 22:38:37 son0p- joins (~ff@181.136.122.143)
2021-07-28 22:42:26 <monochrom> Uh m4 hahahaha
2021-07-28 22:43:05 <monochrom> Someone please concort a shell script that uses sed, and only sed, in a very clever way >:)
2021-07-28 22:43:50 × cheater quits (~Username@user/cheater) (Ping timeout: 255 seconds)
2021-07-28 22:43:55 <dolio> I guess strictly speaking, the orderedness of Agda is likely to be less of a limitation, because it basically means you need to introduce the type of something before referring to it, or the definition of something before depending on the properties thereof.
2021-07-28 22:44:22 <dolio> Which seems like it would correllate with how you'd have to explain things for them to make sense.
2021-07-28 22:46:31 dajoer joins (~david@user/gvx)
2021-07-28 22:47:06 Topsi joins (~Tobias@dyndsl-037-138-065-120.ewe-ip-backbone.de)
2021-07-28 22:48:26 <monochrom> My experience is that, e.g., if an ADT has 4 cases and you have a function that works on that ADT, half of the time it is better to explain the first 2 cases and the first half of your function, and then go back to explain the other 2 cases and the other half of your function.
2021-07-28 22:48:57 <monochrom> In fact I am doing this in my course notes http://www.cs.utoronto.ca/~trebla/CSCC24-2021-Summer/09-semantics-1.html
2021-07-28 22:49:26 <dolio> Yeah, I'm not sure if you can break up definitions like that in Agda.
2021-07-28 22:49:49 <monochrom> Pedagogically it makes no sense to even bring up, e.g., the "VClosure" case of the "Value" type at any early point.
2021-07-28 22:50:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-07-28 22:52:06 <dolio> That idea might have been reinvented many years later as "aspect oriented programming", although I'm not an expert on that, either.
2021-07-28 22:52:16 <monochrom> :)
2021-07-28 22:52:26 <dolio> Much worse name, certainly.
2021-07-28 22:53:05 <monochrom> My recollection is that AOP fizzled because it (or its community) really went the equivalent of the m4 route and it became unwanted madness.
2021-07-28 22:53:10 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-07-28 22:54:38 <monochrom> But AOP did not aim for explaining code, it aimed for keeping code open-world for postmortem additions.
2021-07-28 22:55:28 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
2021-07-28 22:55:59 <dolio> Yeah.
2021-07-28 22:56:20 <dolio> I guess it's the same sort of idea with a different goal in mind.
2021-07-28 22:56:36 <monochrom> Ah, yeah.
2021-07-28 22:58:02 Null_A joins (~null_a@2601:645:8700:2290:2910:fbd1:f882:3730)
2021-07-28 22:58:04 × wroathe quits (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net) (Ping timeout: 250 seconds)
2021-07-28 22:59:30 × vysn quits (~vysn@user/vysn) (Remote host closed the connection)
2021-07-28 22:59:35 <dolio> I guess my hypothesis is that widespread adoption of literate programming tools would probably get you to where AOP went.
2021-07-28 22:59:56 <dolio> Because programmers will care about the code organization possibilities, not writing excellent documentation.
2021-07-28 23:03:09 <johnw> if I have a record data Foo = Foo { a :: Int, b :: Int }, is it possible to write a Traversal' Foo Int over the two members?
2021-07-28 23:03:47 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 252 seconds)
2021-07-28 23:04:32 <dolio> Yes, you can write one.
2021-07-28 23:04:38 <dibblego> yes, though it would be Iso
2021-07-28 23:04:45 <dibblego> (and ∴ traversal)
2021-07-28 23:05:05 <dolio> If the question is whether a library will generate one automatically, I don't know.
2021-07-28 23:05:18 <johnw> I don't know why I'm stuck on this
2021-07-28 23:05:32 <dibblego> generic-lens is the closest you'll get in this regard; I've been down this rabbit hole
2021-07-28 23:05:59 <dibblego> johnw: fooIso = iso (\(Foo x y) -> (x, y)) (uncurry Foo)
2021-07-28 23:06:21 <johnw> I actually want a traversal
2021-07-28 23:06:24 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)

All times are in UTC.