<robtaylor>
<galibert[m]> "what's Clash?" <- clash is a haskell based HDL
<galibert[m]>
oh
jjsuperpower has joined #amaranth-lang
<d1b2>
<Olivier Galibert> Clash's documentation is between catastrophic and inexistant
<whitequark>
yes
<whitequark>
I wouldn't suggest *using* Clash
<whitequark>
but taking ideas from it is pretty alright
<d1b2>
<Olivier Galibert> Well, we also do the mistake of having a domain parameter telling whether the reset is synchronous or not
<d1b2>
<Olivier Galibert> I mean they
<whitequark>
yeah
<galibert[m]>
without in the doc ever defining reset, enable and if they interact in the first place, or whether the reset/enable signals are considered part of the domain
<whitequark>
reset and enable are parameters to the function inferred from the design iirc
<galibert[m]>
which is oh-so-nice if you have multiple clocks on that part of your design I'm sure
<galibert[m]>
One of my criteria for a good documentation for a language is whether you could implement an alternative compiler/whatever from it. Amaranth is so much farther along that path than Clash is it's not funny
<whitequark>
look, I didn't bring it up to argue whether it's better or not, or if it's even a good language to write things in (it appeals to me, personally, but it's irrelevant)
<galibert[m]>
Oh of course
<galibert[m]>
I'm just ranting :-)
<whitequark>
I merely referred to a single concept from it because I think it's useul
<whitequark>
I feel like it's not very productive
<galibert[m]>
Ranting's aim is rarely productivity, but heh
<whitequark>
Rust spaces ask people to not be rude about other programming languages and I think it's a reasonably good rule
<whitequark>
it's just a bad look, you know?
<galibert[m]>
In any case, it's going to be hard to see what Clash's semantics are without looking at the implementation
<galibert[m]>
I have no opinion about the language at this point, the documentation hasn't yet allowed me to understand it (not known haskell specifically probably doesn't help)
<whitequark>
oh yeah it's... difficult to figure out
<whitequark>
I'll get back to everyone later with a clear explanation of what the semantics is, de facto at least
<whitequark>
actually the easiest way is to grab one of their examples and look at the generated verilog :)
<galibert[m]>
black-box reverse-engineering of programming languages, first time I see that
<whitequark>
I've done this before!
<whitequark>
but then I frequent languages with particularly inscrutable semantics
<whitequark>
like Ruby
<whitequark>
actually, one guy wrote a book about Ruby where to understand how it parses he had to write a black box RE tool based on the interpreter
<galibert[m]>
The worst I did is RE-ing a cpu asm from rom dumps (four times, two without even a list of opcodes)
<whitequark>
and then he published it, and there was a mistake because it was still too hard to understand, despite everything being open source
<whitequark>
so the next edition contains a long apology
<whitequark>
I had to have the company I worked for pay a translator like $300 to get that article from Japanese to English
<galibert[m]>
starts to feel like the ruby compiler is a very very good ioccc entry
<whitequark>
the frontend is a single parse.y file that's over 10KLOC long and last time I checked it had several dozen gotos
<whitequark>
the lexer is there too
<galibert[m]>
gotos inside LR-actions?
<galibert[m]>
wow that's... just wow
<whitequark>
it has several concurrently running FSMs (in addition to the implicit FSM in gotos), three stack (push/pop capable) states, and LR lookahead actions change the state of the lexer
<whitequark>
no, gotos inside the lexer
<whitequark>
but it also uses lookahead LALR(1) actions to change lexer state
<galibert[m]>
cute
<whitequark>
also it has unbounded backward lookahead (sorta like C's lexer hack, but in Ruby this can change whether something is a string or not), and as of last version, unbounded forward lookahead
<whitequark>
because x \n .y \n .z is parsed as x.y.z
<whitequark>
x #comment \n .y \n .z, too
<whitequark>
you can nest heredocs in heredocs, and also heredocs in interpolations, arbitrarily deep
<whitequark>
* you can nest heredocs in heredocs (inside interpolations) arbitrarily deep
<whitequark>
so, consider this ruby code
<galibert[m]>
languages are rarely context-free, but there are levels in ignoring Chomsky
<galibert[m]>
C's lexer hack isn't too bad, but perhaps I'm just used to it
<whitequark>
ruby code: p /1 #/
<whitequark>
if `p` is a method (this is the default, it's like print(repr(arg)) in python) then this prints the regular expression "1 #"
<whitequark>
if p is a local variable, it divides p by 1
<galibert[m]>
# is comments?
<galibert[m]>
gah
<galibert[m]>
# is comments?
<whitequark>
yes
<whitequark>
because how space, slash, alnum is parsed depends on whether the ident token before is a variable or not
<whitequark>
i wrote the only and as far as i know still the only independently produced ruby lexer in existence
<whitequark>
and it traumatized me for life, i think
<galibert[m]>
Ruby, because unterstanding perl was too easy, and people don't have keyboards for apl anymore :-)
<galibert[m]>
understanding
<whitequark>
ruby is actually better than perl because at least you can parse it
<whitequark>
meanwhile parsing perl is turing complete
<whitequark>
it supports every ruby version starting with 1.8 to this day
<whitequark>
1.8 has been dead for like a decade, i decided to parse it anyway
<whitequark>
there's like 6 or 7 forks of parse.y there to do it
<whitequark>
the AST gives you precise source location spans for every non-whitespace token (maybe not commas?)
<whitequark>
it is considered the gold standard in ruby spaces I believe
<galibert[m]>
You know, there are less dangerous outlets for masochism, like, I don't know, BDSM, fight clubs, that kind of stuff
<whitequark>
who said I don't do those too? :p
<galibert[m]>
yeah, I guess you find them mild at this point
<whitequark>
a while ago I described my kinks to someone and they said that a normal person would consider them to be on the upper end of extreme
<whitequark>
it barely registers for me, yes
<galibert[m]>
heh
<d1b2>
<j4cbo> I think this is always how it is - what’s way out there to one person is barely dipping your toes in to another
<d1b2>
<j4cbo> kinks, hobbies, etc
<whitequark>
yea
<whitequark>
e.g. I've been known to do USB and Thunderbolt for fun
<adamgreig[m]>
and download counts, don't you do ipaddr on npm too?
<galibert[m]>
You've been known to do usb-pd for fun
<whitequark>
someone I knew found it so profoundly distressing to watch they sent me replacement hardware for free just so I'd stop
<whitequark>
adamgreig: yes
<adamgreig[m]>
npm download counts just seem to dwarf anything else
<whitequark>
oh yeah
<galibert[m]>
35M/week?
<galibert[m]>
that's... insane
<whitequark>
I've never even used that library myself
<adamgreig[m]>
I guess the all-time downloads got too big to display :p
<whitequark>
it was for a project that I've never finished
<FL4SHK>
05:37 <@whitequark> a while ago I described my kinks to someone and they said that a normal person would consider them to be on the upper end of extreme
<FL4SHK>
My kinks are just, boring
<FL4SHK>
but I won't get into them
<FL4SHK>
I'm getting married though
<FL4SHK>
oh yeah
<FL4SHK>
so I'm officially switching to remote work tomorrow
<FL4SHK>
I'm done with work for today too
<FL4SHK>
I finished what I had left to do on the last project I did for my previous team
<FL4SHK>
I'm still going to be working for the same employer, just switching to software dev
<FL4SHK>
I wish I had gotten to write more HDL code for the previous team
<FL4SHK>
but they had me working requirements and documentation of the HDL code
<FL4SHK>
though I did at least get to document the HDL code I had written
<FL4SHK>
thankfully, all that stuff is going out the window with my next position
<whitequark>
will you have time to work on Amaranth?
<FL4SHK>
whitequark: yeah, I will
<FL4SHK>
though I'm not sure I count as a developer of Amaranth itself
<FL4SHK>
I guess that would be fine though :)
<FL4SHK>
btw, I went ahead and started implementing an Interface-like object thing, just for use until everything is built into Amaranth
<FL4SHK>
I don't expect this to take too too long to implement
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #amaranth-lang
cr1901 has quit [Remote host closed the connection]
<charlottia>
charlottia: Was a really good way to learn lexical tie-ins thoroughly -_-
<cr1901>
[positive, negative] x [lookahead, lookbehind] I'm not sure I know what any of those mean (other than I've heard of them)
<cr1901>
whitequark: Are you still interested in the PARTHENON HDL at all? I remember quite a while ago you thought it had interesting ideas (but most of the documentation is Japanese)
jjsuperpower has quit [Ping timeout: 240 seconds]
<whitequark>
yeah sure
<charlottia>
<cr1901> "[positive, negative] x [..." <- It means how a token (or character) is interpreted can be affected by what comes before or after it; e.g. in regular expressions, `/a/` matches the letter a, but `/(?<!x)a/` matches a so long as it doesn’t follow the letter x (negative lookbehind). This is different to `/[^x]a/` which matches a non-x character followed by a, since the lookbehind/ahead variants don’t actually match or
<charlottia>
consume their targets. Without lookbehind/ahead, each character or token would only play into one match (the one that consumes it), but with, any character or token could affect multiple, depending on how far behind or ahead they can look.
<cr1901>
charlottia: Thanks, will have to chew on that for a bit