<devyn>
whitequark: you can certainly say, in Ruby, make an object that proxies transparently over a network. DRuby is probably the simplest example, and is included with Ruby.
malia has joined #elliottcable
yorick has quit [Remote host closed the connection]
malia has quit [Quit: malia]
<devyn>
-learn bork bork bork = Talar du svenska?
<purr>
devyn: Learned `bork bork bork`.
<devyn>
vil: ↑
<devyn>
by the way guys, case fans make a huge fucking difference in temps ^_^
alexgordon has quit [Quit: Computer has gone to sleep.]
<micahjohnston>
do you take actual Ruby code right now?
<whitequark>
define "actual Ruby". Foundry is a distinct language
<whitequark>
I do take some interesting Ruby constructs and make interesting things
<whitequark>
some of the simpler ones:
<whitequark>
A.new. What happens here?
<whitequark>
class Class; def new(*args); klass = allocate; klass.initialize(*args); klass; end; end
<whitequark>
class Class; def allocate; Primitive.allocate(self); end; end
<whitequark>
this is (almost) verbatim code from my stdlib
<whitequark>
now that isn't interesting... yet
<whitequark>
what I do is that if you have a method like this:
<whitequark>
def main; print A.new.calculate_something; end
<whitequark>
then it will be detected that A.new does not escape its scope and it will be allocated on stack.
<whitequark>
interesting? :3
<whitequark>
it's all totally generic. there aren't any hardcoded "new" or "allocate" references in the compiler
<whitequark>
there is more. for example, this method call: "RCC.set(csson: true, hsion: false)" can be translated (even more strong: can be *guaranteed* to translate) to a read-modify-write cycle
<alexgordon>
*micahjohnston holds back the urge to shout RUT!*
<whitequark>
it's just a method call to the compiler. it includes something like "reg = self.read; values.each do |key, value| reg |= (value ? 1 : 0) << @offsets[key]; end" inside
<whitequark>
plain "ruby" code
<micahjohnston>
whitequark: that is definitely interesting
<alexgordon>
micahjohnston: you have to shout rut, otherwise it would just be favouritism!
<micahjohnston>
alexgordon: it's not rut
<whitequark>
wtf is rut?
<micahjohnston>
alexgordon: this is cool compilation techniques
<alexgordon>
micahjohnston: it's ruby!
<micahjohnston>
alexgordon: it's doing cool new things
<alexgordon>
whitequark: I dunno some word that micahjohnston and elliott made up
<whitequark>
well ok
<whitequark>
I'll be at home in half a hour and show moar
<micahjohnston>
this honestly sounds really cool
<micahjohnston>
anyway rut is
<alexgordon>
micahjohnston: so is furrow! and that's super rut
<whitequark>
and explain how this works
<alexgordon>
even Dart does new things
<micahjohnston>
programming language design is stuck in a rut
<whitequark>
argh
<micahjohnston>
everything is imperative expression/statements, side effects, etc.
<micahjohnston>
nobody can conceive of something outside that rut
<micahjohnston>
you are doing cool stuff
<micahjohnston>
Dart is some mash of the uninteresting bits of JS and the uninteresting bits of Java
<vil>
micahjohnston: cool laser bro
<micahjohnston>
vil: thanks :D
<micahjohnston>
vector math!
<vil>
I actually understand that kind!
<micahjohnston>
I solved for the intersection of two vector equations
<micahjohnston>
and turned it into a program
<vil>
can you drag stuff around?
<micahjohnston>
yeah
<micahjohnston>
well
<micahjohnston>
laser points towards mouse
<vil>
oh neat
<alexgordon>
micahjohnston: still doesn't explain how a language which is *based on ruby* is not rut but one which was designed entirely from scratch is...
<alexgordon>
which just reinforces my belief that rut has no definition at all
<micahjohnston>
alexgordon: because it does really cool compilation techniques that change the way it's executed significantly
<alexgordon>
so does furrow...
<micahjohnston>
whereas you are making C++ with a cleaned up syntax that compiles to C++
<alexgordon>
erm
<micahjohnston>
I like furrow
<micahjohnston>
it's still rut
<alexgordon>
that's not furrow
<alexgordon>
that's femtofurrow
<micahjohnston>
oh ok
<micahjohnston>
well
<alexgordon>
furrow is the language I want to make, femtofurrow is the language I have time to make
<alexgordon>
:P
<micahjohnston>
tell me what furrow is then
<micahjohnston>
also the space of programming languages is many-dimensional and whitequark's language is rutty in a lot of them and not rutty in others
<alexgordon>
well both are furrow, the difference is that furrow does its own type checking and compiles down to a lambda calculus which is then optimized and then deoptimized back into C++
<alexgordon>
but I don't have time to do all that, so I'm just doing the first and last bits
<alexgordon>
so it won't be as fast
<alexgordon>
or have as nice error messages
<alexgordon>
but it should still be the same language
<micahjohnston>
ok
<micahjohnston>
see that part of furrow is not as rutty
<alexgordon>
lol
<purr>
lol
<micahjohnston>
but either way
<alexgordon>
sure, but it's actually not necessary *either*
<micahjohnston>
you wear rutty as a badge of pride
<alexgordon>
sure do
<micahjohnston>
because the target audience of furrow is C++ programmers who want their lives improved
<alexgordon>
but I'm not sure the badge means anything, now that there's free entry into museums
<micahjohnston>
like, moving closer to a local maximum
<alexgordon>
micahjohnston: difference between you and me, is that I see the language is a mere hindrance required to use libraries, whereas you see it as important...
<alexgordon>
I don't want to do anything new or interesting in the language, since the standard library is where the real action is
<alexgordon>
would just confuse matters
<micahjohnston>
well that's because you're *assuming* a rutty language and are only improving on the standard library
<micahjohnston>
like, a standard library would look very different in a truly different language
<micahjohnston>
ykonw
<alexgordon>
not really, you can simulate a lot of different types of languages given a flexible enough base language
<whitequark>
home
<whitequark>
alexgordon: you mean make the standard more than, how it is, 1500-page long and make it so that not even a single compliant compiler exists?
<whitequark>
and that when something is wrong in a dark corner, it's an open question whether the compiler is screwed up or the standard?
<whitequark>
yes, that is a truly good way to make a language
<alexgordon>
whitequark: nope, since you can't change all the C++ that's out there
<whitequark>
alexgordon: meh, C99 is not compatible with C89, etc
<whitequark>
that is a fallacy
<whitequark>
I'm not in the mood to argue about C++ anyway
<whitequark>
re lambda calculus: what is the point? lambda calculus is mostly useful because it's simple enough to prove things about it
<alexgordon>
micahjohnston: it's like, some people want to make constructed languages, and some people want to write novels... I'm in the latter category
<whitequark>
and it's not like that part of it matter anymore
<micahjohnston>
alexgordon: decent enough analogy
<whitequark>
you can prove pretty complex stuff with Coq, as it is evident with the formal model of Typed Scheme
<micahjohnston>
alexgordon: though the two aren't really comparable because both of us would be producing programs that people can use
<micahjohnston>
whereas nobody could consume novels written in constructed languages
<whitequark>
re google: google folks only ever make truly boring languages. I believe this is an explicit design decision.
<alexgordon>
I just want a language I can write code in, and not feel like it was designed by an idiot
<alexgordon>
that's *all* I want
<whitequark>
I'm pretty sure it comes out very well for Google. I'm definitely unsure this is the right direction for language evolution
<whitequark>
micahjohnston: lemme show you the code which is going to work with hw registers
<whitequark>
it won't compile all the way down to assembly yet but because other parts of my compiler suck, not because it's inherently faulty :D
<alexgordon>
things I want: compiler that tells me when variables haven't been declared, static typing, no GC, rich set of core data structures, no fucking preprocessor. errr... that's about it.
<whitequark>
alexgordon: you'll <3 foundry
<alexgordon>
only thing I've found so far is Rust, but I dunno, I *like* it but I don't *love* it
<alexgordon>
I think it's too complex
<whitequark>
region analysis *is* complex
<whitequark>
I've looked into it and it's hell of a complicated algorithm, and you can't really steer it into right direction if you want
<whitequark>
even if
<alexgordon>
C++ does about 90% of what I want, the only issue is it also does 80000% of what I don't want
<micahjohnston>
hahaah
* whitequark
things that a language *must* have a way to compose stack maps by default
<whitequark>
and if it can, you can pretty much switch between GC/no GC all the day
<whitequark>
I plan to do cooperative memory allocators sometimes
<alexgordon>
I find I very rarely actually need a GC, not enough to warrant actually having one
<whitequark>
like, independent parts of your code may use different allocation strategies without conflicting and with being checked by the type system
<alexgordon>
most of the time my data "graph" is actually a simple tree
<whitequark>
a part can use a heap, other part a pool allocator, etc
<whitequark>
not yet though.
<alexgordon>
programmers have become so conditioned by pointers and OOP that they don't know how to function without them
<whitequark>
there's a thousand and one definition of OOP
<whitequark>
and C++ is not OOP
<alexgordon>
AFAIK, all oop has some kind of references between objects
<whitequark>
... I would say that pretty much all programming has some kind of references between data structures
<alexgordon>
the specific problem is circular references
<whitequark>
alexgordon: my point is, if your language specifically forbids circular references, it just became a puzzle language.
<alexgordon>
depends which problems you're solving, most of the problems I solve don't ever use any circular references
<alexgordon>
so removing them doesn't make it any harder, it just makes it faster
<whitequark>
but you're designing a language.
<whitequark>
micahjohnston: you seen the code?
<alexgordon>
anyway, I see many uses of circular references that are pointlessly unnecessary, but come from a Java mindset (let's make some classes and get them to talk to each other!)
<alexgordon>
C++ programmers don't tend to have this problem though, since the language dissuades you from using them
<micahjohnston>
whitequark: haven't really studied it yet
<alexgordon>
maybe *that* is the definition of Rut. Whether a Java programmer can use the language without changing how they think hahaha
<whitequark>
micahjohnston: ok tell me when you're confused enough so that I'll tell you how it works :3
<micahjohnston>
all right :p
<micahjohnston>
alexgordon: spoken like a true blub programmer? "every instance of this technique is unnecessary" :p
<whitequark>
yes yes yes ^ that
<alexgordon>
I'm allowed to dislike things!
<micahjohnston>
I would disagree that Haskell is always a puzzle language
<micahjohnston>
it is at first to people who only think imperatively
<micahjohnston>
and it is a bit
<micahjohnston>
but once you've gotten to thinking in the Haskell mindset it's just as natural as imperative stuff to think of a solution to a problem
<whitequark>
this exact sentence is a sign of a puzzle language :p
<micahjohnston>
ok so is a puzzle language just one in which you think differently than in regular rut languages?
<alexgordon>
yes
<micahjohnston>
because if every language had been purely functional from the start I think we'd call imperative languages puzzle languages
<whitequark>
no.
<whitequark>
"there are no functional languages; only functional programs"
<whitequark>
in other words, a functional program works in an imperative language but not vice-versa
<whitequark>
I'm skimming over several things but I hope you see the point.
<alexgordon>
it doesn't really though
<alexgordon>
there are MANY things you can do in haskell you can't in C
<alexgordon>
micahjohnston will now list them
<micahjohnston>
yeah
<whitequark>
let's compare with C++
<micahjohnston>
and like, there's an element of dogmatism/purity in the culture of current purely functional languages
<alexgordon>
shape oriented endofactoriunctors, for a start
<whitequark>
alexgordon: now explain this in English
<micahjohnston>
but like if programming languages had been defined from the basis of purely functional langauges and then nice ways to perform IO had been designed to fit those
<whitequark>
micahjohnston: there's another problem
<micahjohnston>
we would talk about embedding imperative techniques in these languages
<whitequark>
the world around us is imperative and depends on side effects
<micahjohnston>
just because you speak English to describe the world doesn't mean that the world is English
<alexgordon>
this is stupid, some languages are better at some things than other things
<alexgordon>
there are things that are straightforward in Haskell, and a puzzle in C. There are things that are the opposite
<alexgordon>
there are things that are easy in node.js but hard in python!
<FireFly>
"in other words, a functional program works in an imperative language but not vice-versa
<FireFly>
"
<FireFly>
Hrm
<alexgordon>
I find the only thing that actually stops me doing a particular thing is the more boring characteristics of the language, like does it have the right libraries, and is it fast enough?
<FireFly>
I was going to make a point, but I forgot what it was <.<
<micahjohnston>
alexgordon: well said
<micahjohnston>
whitequark: what point did I miss
<micahjohnston>
whitequark: from your article:
<micahjohnston>
So the world is imperative, full of mutations and side-effects. But it seems equally valid to say that the world is a function of time (and other variables) that outputs immutable states. Perhaps both perspectives are two sides of the same coin, just separated by their treatment of time.
<micahjohnston>
which is my point
<micahjohnston>
there is more than one way to model the world, and not all of them are imperative
* FireFly
believes some things lend themseleves to data-abstraction (i.e. OOP) and others to functional abstraction (i.e. FP)
<micahjohnston>
also at the end of the article he says exactly what I've been saying
<whitequark>
micahjohnston: meh consider yourself right for this evening
<micahjohnston>
that most programmers are brainwashed by the von neumann architecture
<whitequark>
though I'd love to see an alternative to von neumann cpus. not even in silicon. just show me a verilog model. or an RTL one. or just about anything.
<whitequark>
btw I know about that zero-entropy thing I don't remember how is it called
<whitequark>
Toffoli and Fredkin gates
<micahjohnston>
oh reversible logic?
<whitequark>
yea
<micahjohnston>
well I mean what about looking at verilog/fpga programming as a paradigm in itself
<micahjohnston>
and making a high-level reactive language that compiles down to that
<micahjohnston>
that's one possible direction
<alexgordon>
toffee gates!
<whitequark>
micahjohnston: haha that is a valid answer btw
* alexgordon
goes back to doing practical stuff ...IN PYTHON
<whitequark>
I like your logic
<whitequark>
micahjohnston: btw I thought up an answer to that "missed the point" stuff
<whitequark>
ah nevermind, it sucks
<whitequark>
micahjohnston: so... wanna hear the explanation of how foundry achieves that yet?
<whitequark>
it's pretty rut I must warn you
<micahjohnston>
whitequark: sure
<micahjohnston>
ok :p
<whitequark>
it has several operations for which it demands/prefers constant operands. so when it looks at one of these, it inlines functions until it gets the goddamn constant it wants so badly
<whitequark>
that's it, in a nutshell.
<whitequark>
this is how you can use #send with a faux-dynamic receiver in a totally static language
<whitequark>
and mostly adhere to Kay's ideal of OOP
<micahjohnston>
oh cool
<micahjohnston>
just execute as much at compile time as possible?
<whitequark>
micahjohnston: yes. partial evaluation is baked in to the core of the language.
<whitequark>
it's part of the spec
<micahjohnston>
partial evaluation?
<whitequark>
yea
<whitequark>
aka "constant folding" in the imperative world :3
<whitequark>
(partial evaluation is a wider term, I think it should be mostly self-explanatory)
<whitequark>
micahjohnston: you can also just execute code at compile-time if you want, without any restrictions, but that's unrelated
<micahjohnston>
would that be for metaprogramming/macro type stuff?
<whitequark>
yep
<whitequark>
or for whatever you want, I dunno, computing sine tables at compile-time so your underpowered MCU doesn't have to
<whitequark>
it executes with the target semantics when cross-compiling
<micahjohnston>
ok cool
<whitequark>
so it's not rut? :D
<micahjohnston>
well I mean the language you program in itself is pretty rutty :p
<micahjohnston>
also rut isn't bad
<micahjohnston>
but yeah there are really cool compilation techniques that nobody does
<micahjohnston>
I like it
<alexgordon>
isn't it funny how
<alexgordon>
if you make a sound, by the time you've registered it, it's already gone
<alexgordon>
but like
<alexgordon>
it definitely existed
<whitequark>
micahjohnston: it will also be self-hosted sometimes :3
<micahjohnston>
alexgordon: yeah
<micahjohnston>
whitequark: cool
<alexgordon>
you're hearing this thing in your head, and you're convinced it's there, but that feeling lasts longer than the sound itself
<whitequark>
alexgordon: zen.
russfran1 is now known as russfrank
<micahjohnston>
alexgordon: yeah brains are cool
<alexgordon>
I like brains
<alexgordon>
BRAAAAAINS
<micahjohnston>
real life
<micahjohnston>
this is the most ridiculous article I've ever read
<vil>
micahjohnston: ...that's not how statistics work at all
<micahjohnston>
vil: yeah lol
<Nuck>
Just read through the backlog
<Nuck>
Laughing at alexgordon being the most realistic person there
<alexgordon>
haha it's not hard when I'm up against micahjohnston
<Nuck>
Seriously, there's very little use in purist programming languages
<Nuck>
Or, phrased anotehr way, extremism is extremely dangerous.
<alexgordon>
hey, I've got no beef with purist programming languages, but someone's got to clean it up afterwards
<alexgordon>
programming "paradigms" have a specific lifecycle: first you have experimental languages like Smalltalk which test out new ideas, then you get popular languages like Java and Ruby which learn from their predecessors and clean it up and make it more realistic
<alexgordon>
we NEED new ideas, and to try new things
<Nuck>
True, the purists matter in history, but not in practice
<alexgordon>
but we also need people to clean up what we have and make it more usable
<Nuck>
Java is not better than the predecessors though
<alexgordon>
it's better in that people use it!
<Nuck>
Cause seriously, Java encourages THE WORST practices
<alexgordon>
Smalltalk wasn't without its problems
<Nuck>
Fair enough
<Nuck>
Ruby <3
<alexgordon>
there's a reason people talk about it in the past tense :P
<alexgordon>
yeah well Ruby took smalltalk in a different direction
<alexgordon>
Objective-C is interesting, it was doomed to the failure of an experimental language for the longest time, then it got shaped in the 2000s into a more useful language
<alexgordon>
...and continues to be made more practical
<alexgordon>
but it was obviously extremely influential in its youth, even if it wasn't all that nice to program in
<alexgordon>
anyway like I said, and I know elliott agrees with me here, you can eat your cake and have it too if you go the Lisp approach and make a very flexible language + a standard library
<alexgordon>
then you can have whatever you want
<Nuck>
So I just had to apply some anti-stain shit to a shirt without a sprayer
<Nuck>
It has the consistency of cum
<Nuck>
And it's fucking nasty
<alexgordon>
interesting, tell me more
<vil>
alexgordon: more
<alexgordon>
mmm something I don't think that gets used too much, but should do: inverse integers
<vil>
what's that?
<alexgordon>
not sure if it has a name other than the one I just made up, basically an extreme form of fixed point
<alexgordon>
0 is 0, 2^64-1 is 1
<alexgordon>
everything inbetween are numbers between 0 and 1
<alexgordon>
so like numbers of the form n / (2^64 - 1)
<alexgordon>
often I want to work with real numbers between 0 and 1, but floating points are too imprecise
<Nuck>
Use a double?
<Nuck>
Also, are there quadruples?
<alexgordon>
Nuck: there's long doubles, 10 bytes, that's as big as you get before it gets slow