« first day (294 days earlier)      last day (1669 days later) » 

2:57 PM
Never tried that before, but should have been obvious I guess..
 
@OMᗺ so the let shadows the where, that makes sense as the let is part of the expression
 
3:16 PM
Exactly, didn't expect the other way round but just never tried it.
But I wouldn't have expected this
or at least that this would work..
 
@OMᗺ you you can use arguments inside thw where clause, so the arguments are in an outer scope compared to the where.
 
Thinking of it that way makes sense, however the very last one is quite unintuitive.. Well, at least there are enough variable names :D
 
@OMᗺ bindings are recursive, so that where is defining chirp in terms of itself
 
I understand why, but my intuition says otherwise.
Never really thought about scopes in Haskell tbh, as this isn't really an issue that would come up in reality..
Apart from that one Haskell-Curry polyglot I doubt that I used a let-binding that isn't in a do {..}-block, I prefer the where-clause more.
 
3:37 PM
@OMᗺ I gereally prefer where, but I have used a let to maintain guarded recursion in the loop parser for my brainfuck interpreter.
 
Oh yeah, I guess that's much cleaner than defining a new function.
In case you're interested, I wrote an interpreter too: github.com/bforte/brainfs
The goal was to include as many derivatives as possible (or I have time/desire) for that polyglot challenge, however it got a bit messy as I started and then more and more stuff was introduced for new ideas and derivatives..
But I think it's quite easy now to add another derivative, as TH takes care of most of the work.. Basically you just need to override some record entries and write a comment that includes name, argument-name and the name of the language description: like this
 
@OMᗺ nice, the only thing that mine supports that yours doesn't is arbitrary cell sizes
 
It does :)
 
In the readme you have a list of finite sizes, plus unbounded. I haven;t looked at the code yet
 
It's in the readme (the last entry u)
 
3:53 PM
What I mean is mine can choose any cell size dynamically, such as cells that hold the values 0-4 or 0-222215553.
It makes sense to special case sizes that correspond to machine integeers though.
 
Ah, I thought arbitrary as in unbounded.. Yeah, I just used Bool, WordX, IntX and Integer
 
Have you thought about teaching it Unary or golunar?
 
No not yet, however there are still a lot left :)
I'll have a look at them though
 
What is happening in Languages.hs?
 
4:23 PM
Just re-exporting all the modules in src/Languages
Basically it generates code like this:
```
module Language ( module L ) where
import Languages.Bla1 as L
import Languages.Bla2 as L
...
```
added Unary.hs
 
@OMᗺ I just made a quick pull request because you forgot to add it to the readme
 
Added it to the readme (and Golunar as well)
 
4:39 PM
there are more efficient ways to convert golunar to brainfuck than going through unary. This is important because often unary programs don't fit in memory
i think it involves doing divMod by 8 on the number
 
Thought about doing basically the same as in bf2unary but instead of doing zeroes just using show, however I was too lazy ;P
 
4:57 PM
@Potato44 This should be way better
 
@OMᗺ yes it should. you still have the problem when going the other way though.
but that just involves the inverse lookup and multiplication by 8
 
Yeah just did that too
That reverse annoys me but appending a 1 will be same cost -.-
 
@OMᗺ should use strict fold left (foldl')
 
Aah true, I always forget about lazyness/strictness..
 
can you get rid of the (1:) by changing the initial valuse of the accumulator of the fold?
 
5:14 PM
Yeah, could just change it to 1
Oh infact that would save me from reversing it, if I stick with foldr!
Ignore my last message, I was confused..
 
5:31 PM
@OMᗺ I think reversing then using a left fold is better anyway because addition and multiplication are strict. so we don't get thunks hanging around
 
5:50 PM
Or using foldr (\a b->8*b + idx alph a) 1 . reverse which avoids foldl', though probably it'll be roughly equivalent in speed.
 
6:11 PM
@OMᗺ since addition is strict you want to be using foldl' though. And why does that still have a reverse if you are folding from the right?
 
The arguments are switched, otherwise you would have to append the 1
 
@OMᗺ didn't we bring the 1 into the accumulator to avoid appending it?
 
To avoid prepending it yeah
 
6:42 PM
Lol, I had a look at it and it never worked out because I fucked up with g2bf...
 

« first day (294 days earlier)      last day (1669 days later) »