code logs -> 2016 -> Fri, 09 Dec 2016< code.20161208.log - code.20161210.log >
--- Log opened Fri Dec 09 00:00:10 2016
00:20
< catalyst>
oh wow
00:20
<@TheWatcher>
?
00:20
< catalyst>
not = {true = false, false = true}
00:21
< catalyst>
error? = {error = true, $else = false}
00:21
< catalyst>
bit = {0 = 0, 1 = 1}
00:21
< catalyst>
is = not/error?
00:21
< catalyst>
is/bit/0 => is/0 => true
00:21
< catalyst>
oh, wait, I missed a step
00:22
< catalyst>
is/0 => not/error?/0 => not/false => true
00:22 * catalyst is playing around with things
00:23 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
00:24
< catalyst>
Essentially, it's a language I'm playing around with that's based entirely on maps of symbol => symbol, where map/key is substituted with the value associated with the key in the map. With a production rule for calculating a member if you try to lookup something that's not in the map.
00:26
< catalyst>
By default {} means {$else = error}, hence {0 = 0, 1 = 1}/0 looks up 0, substituting the m/k expression with 0. {0 = 0, 1 = 1}/melon would try to look up melon, fail, and invoke the default production rule of $else = error, so effectively it becomes {0 = 0, 1 = 1, melon = error}/melon, and then it can lookup melon and substitute the expression with error
00:26
< catalyst>
Since there's always a production rule, you always end up with a value, regardless of what you threw in, so no need for an exception, and I'm finding all sorts of uses for error that include a length function
00:27
< catalyst>
So the identity function is {$x = x}
00:27
< catalyst>
Where anything not found gets replaced by binding x to it, and producing precisely its identity map
00:27
< catalyst>
So {$x = x}/Test effectively becomes {Test = Test}/Test, which when lookup is applied becomes Test
00:28
< catalyst>
And I'm enjoying that identity maps are literally identity sets, so bit = {0 = 0, 1 = 1} means that /0 and /1 become themselves via identity, and anything else applied is an error
00:29
< catalyst>
So the map bit is precisely the identity function for the bit concept
00:30
< catalyst>
So types are implicitly identified via is/<identity-function>
00:30
< catalyst>
bool? = is/bool
00:31
< catalyst>
bool?/false = is/bool/false = is/false = true
00:31 * catalyst chirps happily
00:33
< catalyst>
Then it's possible to calculate the length of a sequence with monotonically increasing keys (as in an array), e.g. {0 = v0, 1 = v1, ..., n = vn}
00:34
< catalyst>
And that's done by using one-past-the-end lookup of getting an error as the base case
00:34
< catalyst>
So length can be found via
00:34
< catalyst>
len' = {$sn = {error = $sn/1,
00:34
< catalyst>
$else = len'/{seq = $sn/seq,
00:34
< catalyst>
n = inc/$sn/n}}
00:34
< catalyst>
/($sn/seq)/($sn/n)}
00:34
< catalyst>
len = {$seq = len'/{seq = $seq, n = 0}}
00:34
< catalyst>
Oh, sorry, that /1 should be /n
00:35
< catalyst>
So I've been able to do this with only {}, $, / and () as syntax, with a symbol being a sequence of atoms, where atom = {0 = 0, ... 9 = 9, a = a, ... Z = Z}
00:36
< catalyst>
Ah, and maps are always evaluated right to left, so x/y/z really means x/(y/z)
00:37
< catalyst>
Sorry, identity ought to be {$x = $x} for clarity
00:37
< catalyst>
Regardless of anything else, I am enjoying myself immensely x)
00:38
< catalyst>
Lookups are evaluated right to left*
00:38
< catalyst>
Oh, ? = ? is also an atom identity I suppose
00:50
< catalyst>
And, I suppose, though it requires some thought as to what's allowed to be subsituted into keys
00:50
< catalyst>
insert = {$mkv = {($mkv/k) = ($mkv/v),
00:50
< catalyst>
$s = $mkv/m/$s}}
00:50
< catalyst>
; insert/{m = {}, k = x, v = 42}
00:50
< catalyst>
; {{m = {}, k = x, v = 42}/k = {m = {}, k = x, v = 42}/v, $s = {m = {}, k = x, v = 42}/m/$s}
00:50
< catalyst>
; {x = 42, $s = {}/$s}}
00:50
<@celticminstrel>
Sounds interesting but really hard to use. :P
00:50
< catalyst>
Well, yeah, I'm trying to work without any syntactic sugar to begin with to see how far I can get :P
00:50
< catalyst>
I'm just fascinated by the concept
00:51
< catalyst>
Sorry:
00:51
< catalyst>
insert = {$mkv = {($mkv/k) = ($mkv/v),
00:51
< catalyst>
$s = ($mkv/m)/$s}}
00:52
< catalyst>
the lookup-from-binding-in-parens pattern is basically binding function parameters I suppose
00:52
< catalyst>
I can probably make that nicer
00:52 Derakon[AFK] is now known as Derakon
00:53
< catalyst>
I'm genuinely intrigued by the identity functions of types being precisely those types though
00:53
< catalyst>
That feels neat
00:53
< catalyst>
Sets of symbols of those types*
01:03 * catalyst keeps skipping production steps in her examples, but neh
01:06 catadroid [catalyst@Nightstar-m0mem8.dab.02.net] has joined #code
01:07
<&ToxicFrog>
catalyst: clearly you need to write a tracing evaluator next, and then use that to generate the examples!
01:07
< catadroid>
Mhm
01:08 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
02:12 catadroid` [catalyst@Nightstar-lfv4ge.dab.02.net] has joined #code
02:15 catadroid [catalyst@Nightstar-m0mem8.dab.02.net] has quit [Ping timeout: 121 seconds]
03:48 * McMartin ponders
03:48
<&McMartin>
This is reminding me a bit of the untyped lambda calculus
05:09 Derakon is now known as Derakon[AFK]
05:19 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
05:29 himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has quit [Connection closed]
05:56 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
06:18 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
06:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
06:24 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
06:59 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
06:59 mode/#code [+o himi] by ChanServ
07:02
< catadroid`>
McMartin: my aim was to produce something from the intuition that function === map
07:02
< catadroid`>
(the entire reason it occurred to me is because dictionary types in clojure are callable)
07:02
<&McMartin>
Aha, thus the family resemblance
07:03
< catadroid`>
And also because I'm convinced that there's something 'beneath' Lisp in a sense
07:03 * McMartin nods
07:03
< catadroid`>
eval/apply feels like it's not quite a basis
07:03
<&McMartin>
I mean, there *is*
07:03 catadroid` is now known as catadroid
07:03
<&McMartin>
In the sense of "Alonzo Church's work in the 30s"
07:03
<&McMartin>
It sounds like you may have already gotten Church Numerals out of your system.
07:04
< catadroid>
Well, eventually that's the actual lambda calculus, right?
07:04
<&McMartin>
My vague recollection is that there are two kinds of lambda calculus
07:04
<&McMartin>
But also that they managed to get a complete system out with nothing but functions and their applications...
07:04
< catadroid>
The very first thing I started building was digit = {0 = 0, 1= 1,..., 9 = 9}
07:05
<&McMartin>
... which, since, as you note, functions<->maps, means that it should be possible to go from there
07:05 * catadroid nods
07:06
< catadroid>
Like, even if I don't expand on it from here, I've been really enjoying myself
07:06
<&McMartin>
Yay
07:06
< catadroid>
I feel genuinely creative for the first time in forever
07:06
<&McMartin>
:D
07:06
< catadroid>
And when I showed my colleague he seemed genuinely interested
07:07
< catadroid>
(someone with a maths background)
07:07
< catadroid>
Also I wanted a language that in a practical sense limits your namespaces
07:08
< catadroid>
The simplest way of doing that is to have an environment lookup in a map that's explicitly mentioning other namespaces
07:09
< catadroid>
And because it can be put onto real machines, it would be possible to do something like +/[4 3 10] and have that call a function in a general case or be replaced with some collection of assembly op codes transparently
07:10
< catadroid>
Meaning that you can express logic and easily translate to whatever platform by replacing your environment dictionary
07:10
< catadroid>
Whereas anything descended from C assumes a sequential machine by default
07:11
<&McMartin>
Yep
07:11
< catadroid>
Essentially this language removes sequence entirely except for the fact that lookups happen in order
07:11
<&McMartin>
"Lazy evaluation"
07:11
<&McMartin>
Haskell went deep for that
07:11
< catadroid>
Basically, but it feels really nice
07:11
< catadroid>
The best thing I've got out of it so far is
07:11
< catadroid>
is = not/error?
07:12
<&McMartin>
Meanwhile, I've just been reminded why I didn't get any good at debugging until 1997
07:12
< catadroid>
thing? = is/thing
07:12
< catadroid>
I just love the way that reads
07:12
<&McMartin>
That's always a fun bit
07:13 * McMartin might have, when Inform 7 came out, written a few works in it just to make the syntax say goofy things >_>
07:13
< catadroid>
:3
07:13
<&McMartin>
"After showing a component (called their doom) to those fools from the Institute: now their doom is sealed; continue the action."
07:14
<&McMartin>
(Inform is a domain-specific language for parser-based text adventures and uses the full power of a text-adventure parser in its own rule specifications)
07:14
< catadroid>
inc-carry = {0 = 10, $x = $x}/inc-digit
07:15
< catadroid>
inc-digit = {0 = 1, 1 = 2,..., 9 = 0}
07:16 Kindamoody[zZz] is now known as Kindamoody
07:16
< catadroid>
inc/carry/0 => 1, inc/carry/9 => 10, inc/carry/test => error
07:17
< catadroid>
That paragraph is glorious, btw
07:17 chatter [NSkiwiirc@Nightstar-ots.m5e.201.109.IP] has joined #code
07:17
< chatter>
hey guys
07:18
<&McMartin>
Sadly, it cannot accept the assertion "a person is seldom on fire" because fire is not an object that you can stack things on top of, and as noted, it's in text adventure logic
07:18
< catadroid>
:<
07:18
< catadroid>
Sadness
07:18
<&McMartin>
You thus have to go with "a person is seldom alight."
07:18
< catadroid>
Have you ever come across anything that looks like what I'm building?
07:19
< catadroid>
Hah!
07:19
< catadroid>
That feels more concise anyway ;)
07:19
<&McMartin>
The syntax you describe is new to me.
07:19
<&McMartin>
The notion of evaluation order not mattering is a fundamental part of purely-functional programming
07:20
<&McMartin>
And I don't know enough about the mathematical theories that inspired Lisp to really evaluate its closeness there.
07:20
< catadroid>
It feels like Haskell without being tied up by a type system
07:20
<&McMartin>
You aren't walking down Prolog's path.
07:20 * McMartin nods
07:20
<&McMartin>
Haskell and the ML family were inspired by the typed lambda calculus, IIRC, and Lisp by the untyped one.
07:20
< catadroid>
And point-free processing feels quite fundamental to God expression here
07:21
< catadroid>
Christ
07:21
< catadroid>
Let's try that again without autocorrect
07:21
<&McMartin>
I keep wanting "point-free" to mean "pointless" >_>
07:21
< catadroid>
Point-free programming feels quite fundamental to good expression
07:22
< catadroid>
Yeah, I've made that assertion too ;)
07:22
<&McMartin>
I definitely like it
07:22 chatter [NSkiwiirc@Nightstar-ots.m5e.201.109.IP] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
07:22
< catadroid>
Everything is curried by default since you can currently only bind a single variable when specificying a production rule
07:23
< catadroid>
(though it feels like there's an opportunity for sugar there if you want it)
07:23
< catadroid>
Specifying*
07:23
< catadroid>
I'm glad you like it
07:23
< catadroid>
ToxicFrog wants an interpreter to play with
07:24
<&McMartin>
I've been back in retro madness mode
07:24
<&McMartin>
I shoudl write more about videogames first
07:24
< catadroid>
(so do I, I should write one. Amusingly I suspect the natural language to do so is C)
07:24
<&McMartin>
Mmm. What leads you to that conclusion?
07:25
< catadroid>
Because there is syntax that lets you look up indices in symbols
07:25
< catadroid>
test-thing/2 => s
07:25
<&McMartin>
Aha
07:25
< catadroid>
And I want to be able to do:
07:26
< catadroid>
tail/test-thing => est-thing
07:26
< catadroid>
And to get both feels a natural fit for using a pointer
07:26
<&McMartin>
I had figured a prototype interpreter would be implemented in a language that already provided map types of its own that could be stolen/piggy-backed upon, but I suppose you have been at the C game for long enough that you might just have those immediately to hand
07:27
< catadroid>
My initial thought was to use clojure
07:27
< catadroid>
But I feel like pointers to chars fundamentally fits what I want
07:27
< catadroid>
No reason I can't implement both ;)
07:28
<&McMartin>
True enough :)
07:28
<&McMartin>
I've always liked the string-as-linked-list-of-chars thing but that's dangerous to commit to early on
07:28
<&McMartin>
But it lets you cons strings together as well as cdr them apart
07:28
< catadroid>
I wrote a hash map class that's faster than std::unordered_map that's in production use in planet coaster and elite
07:28
<&McMartin>
Awesome
07:28
< catadroid>
So I'm not worried that I could do that aspect
07:29
< catadroid>
I'd like to go with structural sharing eventually I think
07:29
< catadroid>
But it's not a prerequisite to begin with
07:29
< catadroid>
More an optimisation
07:30
< catadroid>
Fortunately the I should be able to transparently provide that by swapping the underlying system out with no changes in any code
07:30
< catadroid>
Abstractions \o/
07:31
< catadroid>
And yes, I would love to think about symbols as interpretable as *both* {0 = s0, 1 = s1,..., n = sn}
07:32
< catadroid>
And {car = s0, cdr = {car = s1,... }
07:32
< catadroid>
Depending on context
07:32
< catadroid>
There's some tradeoffs in representation
07:33 * catadroid shrugs
07:33
< catadroid>
Fundamentally, strings being immutable and the default mode for processing them means I like C's contiguous representation in memory
07:33 * McMartin nods
07:33
< catadroid>
But being able to do head/tail and treat them as lists is very handy
07:34
< catadroid>
head = {$x = $x/0}
07:34
< catadroid>
Incidentally
07:35
< catadroid>
Oh!
07:35
< catadroid>
Maybe...
07:36
< catadroid>
tail = {$m = {$k = $m/inc-digit/k} }
07:37
< catadroid>
Err, that last one is $k
07:37
<&McMartin>
Definite shades of the pattern-match case dispatch there.
07:38
< catadroid>
Then tail/test => {$k = test/inc-digit/$k}
07:38
< catadroid>
Which will do the normal lookups most increment k by one
07:38
< catadroid>
Yeah, I like that, even if it could be done much more efficiently
07:39
< catadroid>
It's a nice expression, and naturally leads to error past the end of the sequence
07:39
< catadroid>
In the same way as normal
07:40
< catadroid>
Well, literally every operation in the language is a pattern match, right?
07:40
< catadroid>
Also now I have tail I can write a symbol equivalency function
07:40
< catadroid>
And actually write lookup in a self hosting manner
07:42 * catadroid bounces around happily
07:42
<&McMartin>
:)
07:42 * McMartin will he thinks retire to bed
07:42
< catadroid>
I actually feel like I know what I'm doing
07:42
< catadroid>
Sleep well :)
07:42 * catadroid mentally inserts commas for you
08:01
< catadroid>
Another aspect of this language - it feels tremendously easy to teach people
08:02
< catadroid>
Hm. Maybe I can could use . as a higher priority lookup than /
08:03
< catadroid>
x.y/z => (x/y)/z
08:04
< catadroid>
That way {$x = $x.n/inc/$x.q}
08:08
< catadroid>
len' {$/seq $/n = {error = $n, $else = len'/{seq = $seq, n = inc/$n} }
08:10
< catadroid>
len' = {$sn = {error = $sn.n, ...} }
08:12
< catadroid>
Another bonus - in this language = really does mean substitute equals for equals
08:43 catadroid` [catalyst@Nightstar-0fc552.dab.02.net] has joined #code
08:45 catadroid [catalyst@Nightstar-lfv4ge.dab.02.net] has quit [Ping timeout: 121 seconds]
09:17 Kindamoody is now known as Kindamoody|afk
09:47 catadroid` is now known as catadroid
10:03 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
10:03 mode/#code [+o Emmy] by ChanServ
13:25 Pi [sid25146@Nightstar-kt1.9ff.184.192.IP] has quit [[NS] Quit: ]
13:25 Pi [sid25146@Nightstar-ed0oqj.irccloud.com] has joined #code
13:25 mode/#code [+o Pi] by ChanServ
14:09 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
14:19
<&[R]>
"ProTip: Dont install too many fonts on your computer it slows down the boot process."
14:44
<@gnolam>
... well that test concluded a bit faster than I expected.
14:45
<@gnolam>
Thought had gone wrong, but no.
14:45
<@gnolam>
*Thought something had gone wrong
14:46
<@gnolam>
Seems the few tweaks I made since the last one really did cut the processing time from 5 h 48 min to 24 s.
14:48
<&[R]>
Nice
14:49
< catadroid>
"tweaks"
14:49
< catadroid>
That's awesome
14:52 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
14:52 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:00
< catadroid>
Yeah, my language feels like the untyped lambda calculus in a lot of its form
15:04
<@simon_>
far shot: does anyone here collect old MUD engine source code? I'm looking for DikuMUD Alfa from 1991.
15:13 catadroid` [catalyst@Nightstar-vm6.159.132.82.IP] has joined #code
15:15 catadroid [catalyst@Nightstar-0fc552.dab.02.net] has quit [Ping timeout: 121 seconds]
15:18
<&ToxicFrog>
[R]: wut
15:18
<&ToxicFrog>
catadroid`: clojure treats strings as Seqs of chars anyways, seems like it would be convenient
15:19 catadroid` [catalyst@Nightstar-vm6.159.132.82.IP] has quit [Ping timeout: 121 seconds]
15:32
<@simon_>
https://github.com/sneezymud/dikumud !
15:32
<&[R]>
ToxicFrog: the font thing?
15:33
<&ToxicFrog>
yes
15:34
<&[R]>
I don't know, random imgur comment
15:37
<~Vornicus>
<catadroid> And point-free processing feels quite fundamental to God expression here <--- for a moment I thought you'd gone round the bend. ...also the "allah is doing" guy was there when you said it.
15:53 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has joined #code
15:53 mode/#code [+o celticminstrel] by ChanServ
16:10 catadroid [catalyst@Nightstar-3r9fah.dab.02.net] has joined #code
17:13 Alek [Alek@Nightstar-cltq0r.il.comcast.net] has quit [Ping timeout: 121 seconds]
17:16 Alek [Alek@Nightstar-cltq0r.il.comcast.net] has joined #code
17:16 mode/#code [+o Alek] by ChanServ
18:13 Kindamoody|afk is now known as Kindamoody
20:37 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
21:47 Kindamoody is now known as Kindamoody[zZz]
21:47 catadroid` [catalyst@Nightstar-pmkvjd.dab.02.net] has joined #code
21:50 catadroid [catalyst@Nightstar-3r9fah.dab.02.net] has quit [Ping timeout: 121 seconds]
22:32
< catalyst>
{$x = $x$x}/{$x = $x$x} => {$x = $x$x}/{$x = $x$x}
22:32
< catalyst>
:D
22:33
<~Vornicus>
...
22:33
<~Vornicus>
what even is that
22:33
< catalyst>
Hm?
22:34
<~Vornicus>
I can't read it. what's it supposed to mean?
22:34
< catalyst>
It's a little language I've been working on
22:35
< catalyst>
The premise is that everything is a symbol or a map of symbol => symbol pairs
22:35
< catalyst>
/ is lookup
22:35
< catalyst>
so m/k looks up k in m, and if found, returns the values associated with it
22:35
< catalyst>
So, for example: not = { true = false, false = true }
22:35
< catalyst>
And then looking up: not/false => true
22:36
< catalyst>
The $ notation is a production rule
22:36
< catalyst>
Every map has precisely one of those
22:36
< catalyst>
The default is {$else = error}, so whatever you lookup in that map returns error by substituting the $ variable in the expression on the right then evaluating to that
22:37
< catalyst>
so {$x = $x} is the identity function, since {$x = $x}/symbol => {symbol = symbol}/symbol
22:37
< catalyst>
=> symbol
22:37
< catalyst>
Hence {$x = $x$x} means take the thing looked up and duplicate it
22:37
< catalyst>
{$x = $x$x}/42 => {42 = 4242}/42 => 4242
22:38
< catalyst>
(=> here means 'evaluates to' but it's syntax, just me showing steps}
22:38
< catalyst>
(it's *not* syntax)
22:38
< catalyst>
Oh, I got it wrong
22:38
< catalyst>
It's suppose to be:
22:38
<~Vornicus>
...so you've built yourself a quine?
22:39
< catalyst>
So {$x = $x/$x}/{$x = $x/$x}
22:39
< catalyst>
=> {{$x = $x/$x} => {$x = $x/$x}/{$x = $x/$x}}/{$x = $x/$x}
22:39
< catalyst>
yes
22:39
< catalyst>
It's the omega(?) function from the untyped lambda calculus
22:40
<~Vornicus>
Yeah, I have to say, this is looking a lot like the shit I learned from taht weird smullyan book
22:43 Derakon[AFK] [chriswei@Nightstar-5mvs4e.ca.comcast.net] has quit [Ping timeout: 121 seconds]
22:44
<&ToxicFrog>
Hmm.
22:44
<&ToxicFrog>
So, I have a computer case layout/airflow question.
22:44 Derakon [chriswei@Nightstar-5mvs4e.ca.comcast.net] has joined #code
22:44 mode/#code [+ao Derakon Derakon] by ChanServ
22:45
<&ToxicFrog>
I have four* fans in the case. Two of them are 120mm intake fans pulling air in across the hard drives and into the case. One is a 120mm exhaust fan in the upper rear of the case. The last is a 140mm exhaust fan at the top of the case.
22:45
<&ToxicFrog>
* disregarding the CPU fan, which has a dedicated header, and the PSU fan, which is internal to the PSU and self-regulating
22:46
<&ToxicFrog>
The motherboard, meanwhile, has only three fan headers: CHASSIS_1, CHASSIS_2, and PWR_1
22:46
<&ToxicFrog>
So three of the fans are going to be regulated by these headers and one is going to run flat-out all the time.
22:47
<&ToxicFrog>
I figure that the 140mm should be the always-on one, as the largest, and thus slowest and quietest, fan
22:48
<&ToxicFrog>
But I'm not sure how best to hook up the other two.
22:48
<&ToxicFrog>
Intake fans on CHASSIS_* and exhaust fan on PWR?
23:05
<&ToxicFrog>
...ok, this is all academic right now, because the intake fans have really short cables that won't reach the motherboard
23:06
<&ToxicFrog>
So until I can find fan cable extenders, I guess those are connecting straight to the PSU and the exhaust fans to the CHASSIS_* headers
23:24
<&ToxicFrog>
Ok, and if I'm getting extenders anyways, I might as well get splitters
23:25
<&ToxicFrog>
So the intake fans will connect to CHASSIS_1 and the exhaust fans to CHASSIS_2 and PWR will be left empty
--- Log closed Sat Dec 10 00:00:11 2016
code logs -> 2016 -> Fri, 09 Dec 2016< code.20161208.log - code.20161210.log >

[ Latest log file ]