ec changed the topic of #elliottcable to: #
yorick has quit [Remote host closed the connection]
alexgordon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
eligrey has quit [Quit: Leaving]
jesusabdullah has quit [Read error: Operation timed out]
jesusabdullah has joined #elliottcable
<devyn> I think I'm in love with plain ol' xft:fixed:pixelsize=14:antialias=false
<devyn> I didn't think I'd like to so much
<devyn> it*
* whitequark pukes
<devyn> ikr
<devyn> so why the fuck do I like it
<whitequark> ugh
<devyn> maybe it's a phase
<devyn> maybe I just like it because I'm tired of well rendered fonts
<devyn> ewww that title font is the worst
<devyn> that's an ok font for code but I've seen better
<whitequark> that title font is amazing
<whitequark> F21 BlackletterTypewriter
<whitequark> I spent a ridiculous amount of time looking for something like that on the net
<devyn> not as a title font it isn't.
<devyn> er
<devyn> well yeah
<devyn> but not as a font there
<devyn> lol
<purr> lol
<devyn> it'd look great in another context I think
<whitequark> well I initially intended it to only go to the status bar
<whitequark> but i3 kinda wants it everywhere
<whitequark> so, whatever.
<whitequark> also
<devyn> hmm... maybe if it were just the status bar
<devyn> and you made the status bar more newspapery
<devyn> lol
<devyn> also what's up with your st2 tabs
<devyn> the text looks cut off
<whitequark> devyn: also this: http://i.imgur.com/33QZjxV.png
<whitequark> it's truly horrible
<whitequark> but I enjoy it in a perverted way
<devyn> holy fuck.
<devyn> noooo
* devyn dies
<whitequark> lol
<purr> lol
<devyn> you have to troll ec with that
<whitequark> re st2: it's st3 (doesn't matter), and it has my hack for hidpi on linux
<devyn> ah
<whitequark> but it has a fixed pixel height hardcoded somewhere
<devyn> I see
<whitequark> also you can't really enlarge the sidebar font, which also sucks
<devyn> well I didn't realize there was an st3
<whitequark> and selector (Shirt+Ctrl+P, etc)
<whitequark> all reported to the author but he's kinda lazy
<devyn> heh
<whitequark> why did I even bother to buy it
<whitequark> фдыщ
<devyn> I'm happy with vim
<whitequark> also
<whitequark> <3 ocaml
<purr> Let it be known that whitequark hearts ocaml.
<devyn> fduscsh or something
<devyn> shch
<devyn> idk
<devyn> haven't paid much attention to cyrillic
<whitequark> wrong layout
<devyn> heh
<devyn> whitequark: oh yeah, I noticed it was OCaml... never used it myself but it just looks like any other FP-oriented language to me lol
<purr> lol
<whitequark> well
<whitequark> it's "practical"
<whitequark> which means people actually use it and it allows you to do weird shit if you want
<whitequark> like bypassing type system
<devyn> like unsafeCoerce? :)
<whitequark> I like practical things
<whitequark> well
<whitequark> I'll take a second look at haskell when monads will start to compose nicely
<whitequark> aka, when I will be able to present a pure interface from impure implementation.
<whitequark> a huge plus of ocaml for me is that it has LLVM bindings
<whitequark> and those mostly (as I've learned tonight... :/) don't segfault if I misplace a thing somewhere
<whitequark> LLVM fucking loves to segfault
<whitequark> look at it the wrong way, boom, you have a coredump
<devyn> monadic IO is shitty, but presenting a pure interface from an impure implementation in a good™ way means, to me, using contracts of some sort
<whitequark> elaborate ?
<devyn> essentially, if you're going to do that, you should have to guarantee to the compiler that your code is safe
<devyn> a lot of imperative languages hit a bit of a wall with optimization
<devyn> because they have to assume a lot of things are out of their control
<whitequark> hm
<devyn> you can apply a lot of optimizations to pure Haskell code because the compiler knows absolutely everything that can possibly happen with that code
<whitequark> a lot of languages try to cram insane amounts of invariants in the type system
<whitequark> I think it's simply a wrong way to do it
<whitequark> since your type system, no matter how expressive it is, is not absolutely expressive (or otherwise you'd solve the halting problem)
<whitequark> and in practice, you're bound to have and need an invariant which it cannot express
<whitequark> the simplest form of it is "a remote service"
<devyn> and Haskell solves that rather crudely by putting anything that involves IO "outside the box" so to speak
<whitequark> in Foundry, I use the type system mainly for generic programming--inferencer "fills in the blanks" in the generic code
<whitequark> and there are some very very very basic invariants which also give disproportionally huge benefits when optimizing
<whitequark> such as immutable bindings
<whitequark> optimizers <3 immutable bindings
<devyn> heh
<whitequark> I don't really think that stuff like laziness and parallelization should be handled by the compiler in the general case
<whitequark> since that means that people will have a hard time reasoning about the behavior
<whitequark> Foundry's optimizer is a) really dumb: it's a partial evaluator which evaluates *all* paths it could, and eta-expands a certain subset of functions
<whitequark> and b) predictable: you cannot even disable it.
<devyn> fair enough. I'm not convinced they should be either
<devyn> not saying Haskell is some kind of godly language, because it isn't; there are many instances in which I just can't use it because it would be so horrible
<devyn> there are also things it does very well
* whitequark nods
<whitequark> OOP in OCaml is unusable
<whitequark> for example, it cannot type two classes with a parent-child link where the parent creates the child
<whitequark> the inferencer chokes somehow and I never found a way to fix it, or got anyone to fix it for me
<devyn> huh
<whitequark> I blame early binding
<whitequark> I really don't like how OCaml binds *everything* excessively early
<whitequark> makes any metaprogramming an incredible PITA
<whitequark> I mean, I see how it is designed in a consistent way and that way probably even makes sense in theory
<whitequark> but after ruby, this is goddamn painful
<devyn> haha, yes, if I have a very general-purpose program that doesn't need to be horribly fast and is fairly non-abstract, you bet I'm going to use Ruby
<whitequark> Foundry has two phases, so it is not a problem for it... first metaprogramming, then early binding
<whitequark> also did you read my article?
<whitequark> on metaprogramming in foundry
<devyn> I didn't
<devyn> linky
<whitequark> it's fairly dense so unfortunately most of people I know kind of passed it :/
<whitequark> by the way, talking about ocaml
<whitequark> I rewrote the compiler ruby → ocaml
<whitequark> didn't regret it even for a second. only a masochist would implement a language in ruby.
<whitequark> ocaml is not ideally suited for it, but is lightyears ahead ruby
<whitequark> like it very much.
<devyn> whitequark: reading through your article
<devyn> this is very exciting
<devyn> I love it
<whitequark> ^_^
<devyn> from the looks of it you've basically made something that feels just like Ruby but compiles to machine code, is statically typed, and is fully transparent to the underlying machine, the latter point being frequently overlooked in new "systems programming" languages
<whitequark> yes
<whitequark> there are a few incorrect stances in it due to various modifications I added since I originally wrote it
<whitequark> for example Foundry will support true polytypes
<whitequark> that's required for proper region inference
<whitequark> generally, this does not work well if I want precise garbage collection, so it's probably not worth it to support polytypes generally
<whitequark> should investigate that though
<devyn> this looks really great
<devyn> finished reading btw
<devyn> whitequark: how's C interop right now?
<whitequark> right at this moment the compiler I have at hand doesn't have it :) but for that matter it's very much WIP so I'll explain how its basics combine
<whitequark> so. I have a set of basic types, e.g. parametric width integers and tuples, which map directly to LLVM types
<whitequark> so if you need simple C interop, you do smth like "def self.c_method(x, y) : (Unsigned(32), Unsigned(32)) -> Signed(16) = external "c_method"
<whitequark> that however doesn't deal with memory lifetime
<whitequark> so, since regions allow me to do it very cleanly, I add a *limited* form of RAII, just to manage the memory allocated inside C code
<whitequark> so if you have foo_create, foo_perform and foo_finalize, that'd be a class with def initialize, def perform and def finalize
<whitequark> which map to the C operations and integrate with object lifecycle in Foundry
<whitequark> you could also tweak the regions with the standard language tools, e.g. if your foo_create allocates shit at heap, you explicitly stuff the outermost region in the class you define
<whitequark> and if foo_create initializes a memory region you provide for it, well, you can also express that
<devyn> hm
<devyn> okay
<whitequark> if you want to call Foundry from C, well, you can also do that--Foundry will create a function for every method you export, and decent LTO will get rid of call penalty for field access
<whitequark> if you want to *allocate* Foundry from C, things get tricky
<whitequark> honestly I've no idea how/if I will provide that
<whitequark> most likely you'll have to write some shims yoursel.f
<devyn> fair enough
<devyn> well Foundry sounds really great to me
<whitequark> cool
<whitequark> working really hard right now to get it in shape
<whitequark> I have some demo boards already, and everything should be good for a small demo on 27th Sep
<devyn> when you do I'd be willing to help with stdlib I guess
<whitequark> oh that's really nice
<whitequark> you'll get a free demo board :)
<devyn> :)
<whitequark> but first I need to figure out why they literally explode
<devyn> what do you mean by demo board lol
<purr> lol
<whitequark> well
<whitequark> it's a PCB with an STM32 ARM chip on it, a small monochrome display, several buttons and a buzzer
<whitequark> like a very very old handhend game console, sorta
<devyn> and you wanna run foundry on it?
<whitequark> yep
<devyn> sweeeet
<devyn> dude that's awesome
<whitequark> 20k of RAM
<whitequark> that's like a boatload
<devyn> yeah you can do a lot with 20k when the architecture doesn't make things gigantic :)
<whitequark> yeah
<whitequark> and Foundry really shines when you have similar interfaces (eg SPI I2C) but very different underlying hardware.
<whitequark> heck, you can properly work with registers
<whitequark> RCC.cr.set(hsien: true)
<devyn> wow
<whitequark> which translates to an RMW cycle
<whitequark> with proper atomic access and alignment
jesusabdullah has quit [Ping timeout: 260 seconds]
jesusabdullah has joined #elliottcable
<whitequark> and the register definitions are plain Foundry code in headers, in the ruby dsl style :)
<devyn> you are a god o/
<whitequark> register :cr, 0x100 do field :hsien, :bool, 1 end
<whitequark> like this.
<whitequark> lol
<purr> lol
<whitequark> i just wrote a partial evaluator
<whitequark> dunno why it never occured to anyone else before
<devyn> lol
<devyn> so, I realize regexen probably aren't a core feature of the language (lol), but is there any way we can get something nicer than new Regexp("this.is.a.regex.string") grossness?
<whitequark> sorta
<whitequark> I actually need it very much, because embedded's kind of centered around various efficient FSMs
<whitequark> and most of them are regexps essentially
<whitequark> so
<whitequark> you might've seen a section on language composition in the article
<whitequark> what I want is to have a "quasiquotation for languages"
<whitequark> so that I could for example write a "ragel literal", then interpolate my Foundry code back inside this literal
<whitequark> my idea of how to implement that is twofold
<whitequark> first, restrict the interface, both inwards ("interpolation") and outwards ("value") to procedures
<devyn> oh that's a nice way to do it
<whitequark> i.e. a "language literal" returns a closure, and its interpolations also appear as closures.
<whitequark> then, in your host language you probably want pattern matching or at least nice structure decomposition
<whitequark> (record)
<whitequark> so for example you could do smth like: %bison{ lp=lparen xs=args rp=rparen #{ (lp:, xs:, rp:) { ... } } }
<whitequark> here I am using the Foundry keyword argument syntax
<whitequark> it's not as beautiful as e.g. parser combinators, or PEG combinators, or that funky thing Alan Kay does
<whitequark> but it's like 1000 times simpler
<whitequark> and you could retrofit existing LR parsers to work with this.
<whitequark> (incidentally, implementing an FSM engine in Foundry will also make it optimize really, really well. and all you need to do is to make a bunch of closures.)
<whitequark> the best part about it is that you don't even need to parse the literal yourself
<whitequark> you can offload to existing tooling.
<whitequark> just need to generate some shims, which you can do, because, duh, metaprogramming!
<whitequark> the %bison thingy is simply a piece of syntactic sugar for passing the very simple (two node types) AST to a certain function
<whitequark> [ "lp=lparen xs=args rp=rparen", (lp:, xs:, rp:) { ... }, "\n" ]
<whitequark> sorta
<devyn> [] are tuples... are tuples' sizes not part of their type?
<whitequark> they are
<whitequark> tuples are like... type [Integer, String]
<whitequark> heteromorphic and fixed-size
<devyn> yes, as they generally are...
<whitequark> yea
<whitequark> I also have a *lot* of literals, all with pattern matching
<whitequark> for example pattern matching of byte arrays
<whitequark> case chunk; when [|"IPNG", x|]
<devyn> in that case how does %lang{ aa bb #{cc} dd #{ee} } work?
<whitequark> hm
<whitequark> oh
<whitequark> I conflated syntaxes
<whitequark> that would be an array of some AST type, you can represent it with a union
<whitequark> like [| U(String, Lambda) |]
<whitequark> for example
<whitequark> or you could make a class wrapper for that.
<devyn> U(a, b, ...) makes a union?
<whitequark> yes
<whitequark> that's a major point in fact. unlike most functional langs, I have ADTs kind of inside out
<whitequark> instead of naming things and attaching a type to these names, I allow to group an arbitrary set of types into a tagged union
<whitequark> gives several advantages: works better with classes, you can group stuff which the author of it didn't mean to group
<whitequark> you can narrow the unions.
<whitequark> in particular instead of Option, I have U(ty, Nil)
<whitequark> also you can perform method dispatch through the union, if the signatures allow.
<whitequark> so say there's Nil#nil? and ty#nil?, if you call U(ty, Nil)#nil?, the correct #nil? will be called.
<devyn> alright
<devyn> U is not some kind of reserved keyword, right? it exists at type-level?
<whitequark> yes and no, it's a magical type
<whitequark> in the sense that you cannot define one like that yourself
<whitequark> neither you can define Tuple, Record, or Lambda
<whitequark> but to the user, it looks like just a slightly weird type constructor
<devyn> would it be possible to define an A(a, b, ...) = U(a, b, ...) for example?
<whitequark> you mean assign an alias to a union type? sure
<whitequark> A = U(a, b, ...)
<devyn> no, I mean make an A method that takes types and returns a union type, hell, even just aliasing A = U
<whitequark> oh
<whitequark> yeah. it's syntactically awkward but you can totally do that
<devyn> as long as it's possible :)
<whitequark> yup
<whitequark> in fact you can interpolate local variables inside types
<whitequark> so say: let a = Integer; type [String, a] # => type [String, Integer]
<whitequark> or let a = Integer; let b : a = 1
<devyn> hm, hold on, what do polytypes look like again in your notation?
<whitequark> it's pretty funny
<whitequark> when you write down a type variable literal, if there isn't one it gets created
<whitequark> so polytypes are implicit
<whitequark> def foo(x) : \a -> \a; end
<whitequark> would be one
<whitequark> well, : (\a) -> \a
<devyn> ok, cool
<whitequark> when you try to apply foo to something, the inferencer matches the signature of foo against the signature you're trying to impose on it
<whitequark> so if you're applying it to an Integer, it binds \a to Integer *inside that signature*, and treats every other \a as Integer
<whitequark> what I don't have syntax yet is type constraints
<devyn> do you have anything type constraint-related yet?
<whitequark> say (\a) -> \a with \a <: Foo
<devyn> that brings up another thought
<devyn> does Foundry have mixins?
<whitequark> of course
<whitequark> `mixin Foo; end` :)
<devyn> so then is \a <: Foo only inheritance or mixin as well?
<whitequark> inheritance. mixins don't add anything to the type
<whitequark> well, when you only look at subtyping.
<whitequark> Foundry also has elements of structural typing though
<whitequark> for example you may want something to respond to #each, or to be Enumerable
<whitequark> so Foundry also has interfaces, which are just bags of method signatures with type variables (first case)
<whitequark> and you can also request it to verify that some object indeed implements all methods of a certain mixin, as a convenience
<whitequark> it does *not* check that a certain mixin is included, though; that'd break abstraction.
<whitequark> it verifies that signatures check out.
<devyn> right
<whitequark> fun thing
<whitequark> I technically can run arbitrary code while typechecking
<whitequark> I even had that in the prototypes
<whitequark> *prototype
<whitequark> but I think it's far too dangerous to expose to the user
<whitequark> so for example it's totally possible to have user-defined type constraints
<whitequark> the bad part is that you cannot guarantee that they terminate in bounded time, or are idempotent, or well, not much at all
<whitequark> so I'm in doubt
<devyn> yeah, I don't know
<devyn> I'd allow it anyway but make sure people are forced to read a warning label before documentation of that feature is presented
<devyn> "handle with extreme care"
<devyn> lol
<purr> lol
<whitequark> yea, something like that
<devyn> ok. I'm going to sleep
<devyn> this is really cool
<devyn> thanks for showing me
<whitequark> o/
<devyn> \o
sharkbot has quit [Remote host closed the connection]
sharkbot has joined #elliottcable
cloudhead has joined #elliottcable
yorick has joined #elliottcable
cloudhead has quit [*.net *.split]
wudofyr has quit [*.net *.split]
cloudhead has joined #elliottcable
wudofyr has joined #elliottcable
cloudhea1 has joined #elliottcable
cloudhead has quit [Ping timeout: 276 seconds]
Sgeo has quit [Read error: Connection reset by peer]
PragCypher has joined #elliottcable
audy has quit [Changing host]
audy has joined #elliottcable
eligrey has joined #elliottcable
cloudhea1 has quit [Ping timeout: 256 seconds]
PragCypher has quit [Quit: Leaving]
alexgordon has joined #elliottcable
_whitelogger has joined #elliottcable
Sgeo has joined #elliottcable