IRC channel logs

2015-04-06.log

back to list of logs

***wleslie_ is now known as protocol_fairy
***protocol_fairy is now known as eilselw
***eilselw is now known as wleslie
<dsmith-work>Morning Greetings, Guilers
<nalaginrut>heya
<nalaginrut>one more hour I can say "morning" then ;-P
<dsmith-work>nalaginrut: I'm on IRC Standard Time, of course..
<nalaginrut>yeah, I know ;-D
<dsmith-work>sneek morning is http://www.total-knowledge.com/~ilya/mips/ugt.html
<sneek>Understood.
<dsmith-work>sneek UGT is http://www.total-knowledge.com/~ilya/mips/ugt.html
<sneek>Got it.
<paroneayea>language people, what's the best way to learn to grok BNF forms, and other compiler concepts? Is dumping money into http://www.amazon.com/Compilers-Principles-Techniques-Tools-Edition/dp/0321486811 really necessary?
<mark_weaver>well, it depends what "other compiler concepts" you mean
<mark_weaver>but if you want to learn about compilers, you might find Andrew W. Appel's Modern compiler implementation in {ML,Java,C} more modern and accessible
<mark_weaver>(there are three books, almost the same but using a different language in the example code for the compilers being built)
<mark_weaver>and as I recall, it has better coverage of concepts relevant to functional languages, but maybe I'm out of date -- the last time I looked at Aho Sethi Ullman was over 20 years ago
<paroneayea>mark_weaver: gotcha, thanks :)
<mark_weaver>paroneayea: but if you just want to grok BNF, you don't need such a book
<mark_weaver>mostly you just need to understand the concept of a generative grammar
<zacts>I didn't like BNF
<zacts>it seems limiting to me
<zacts>rigid
<djcb`>hmm, how do the SCM_ASSERT, scm_assert_smob_type etc. macros actually work?
<djcb`>do they return from the C-function?
<mark_weaver>paroneayea: here's the first tutorial I found in a web search. it might be helpful: http://homepages.rpi.edu/~bonisp/fuzzy-course/99/L5/grammarnotes.pdf
<mark_weaver>#guix
<mark_weaver>(oops)
<paroneayea>thank you mark_weaver !
<mark_weaver>djcb`: they throw an exception on failure
<mark_weaver>throwing an exception in guile basically uses longjmp to the nearest enclosing exception handler
<mark_weaver>zacts: you need to learn more about programming language theory before making such a statement
<mark_weaver>BNF can express any "context-free language"
<zacts>mark_weaver: fair enough
<mark_weaver>it's true that being "context-free" is a limitation, but it's a limitation with advantages
<mark_weaver>in general, too much generality in one area of a system usually entails less freedom in other areas
<djcb`>mark_weaver: ah, the longjmp black magic... thanks.
<mark_weaver>for example, objects with mutable state and built-in methods that you call instead of accessing fields directly is a more general mechanism. sounds great. it gives much more flexibility to the person implementing that object.
<mark_weaver>but on the flip side, users of objects have much constrained freedom in what they can do with those objects
<mark_weaver>data can be copied, cached, transferred over a network, stored on disk, etc.
<mark_weaver>what you can do with objects is much more limited
*mark_weaver goes afk
<mark_weaver>djcb`: see section 6.13.8 (Exceptions) of the guile manual for more details
<djcb`>mark_weaver: thanks! found it now...
<djcb`>is there a way to free the error after the assert?
<djcb`>ie. i have some error information in a GError, but I'd need to free it after passing the error string etc. in the SCM_ASSERT
***jao` is now known as jao
*nalaginrut just finished MAL interpreter https://github.com/kanaka/mal/tree/master/guile
*nalaginrut go to bed...zzzZZZ
<nalaginrut>there're less than 4 hours to dream...
<mark_weaver>djcb: see section 6.13.10 (Dynamic Wind), in particular scm_dynwind_begin, scm_dynwind_end, scm_dynwind_free, and more generally scm_dynwind_unwind_handler