« first day (1868 days earlier)      last day (3082 days later) » 

10:00 AM
Oh god, you're one of those people.
 
he likes Eyes wide shut - he's one of those people :-\
 
Aliens
 
You like his worse movies!
 
groups you into category of people who enjoy Kubrick :)
 
@Elyse The second set of face pictures are laughing at you
Yes, you
you know what was a good movie? mad max
MEDIOCRE
 
10:05 AM
I can't really enjoy any movie where it takes effort to disable a computer. Just waiting until the next Windows/Flash/whatever update usually works fine.
 
@ScottW The "those people" I was talking about was "those people who think 2001 is great".
@ScottW Not among my friends, by definition.
 
Xeo
lol
@Prismatic yes.
 
user1804599
 
user1804599
fucking keming
 
10:07 AM
I don't get Tarantino movies.
 
@ScottW Inglourious Basterds
 
So none of them.
 
sbi
@Jefery You don't? You can get them here in any supermarket.
 
@ScottW Django Unchained.
 
Yeah maybe Django is the one that makes most sense.
 
10:09 AM
yeah I liked it
 
I enjoyed Django Unchained but it is one of those that ends too many times.
 
I would have liked Inglorious Basterds more than Django Unchained if the ending wasn't so weird
 
tarantino's thing is tension
 
I like Inside Out
 
I love the scenes in all his films where there's really tense stuff going on
 
10:10 AM
@Prismatic So not Kill Bill.
 
but the uberviolence doesn't necessarily appeal to me... ie I dont usually find it stylistic
@R.MartinhoFernandes Yeah wasn't a huge fan of Kill Bill though I'll admit I don't remember too much of it
 
Kill Bill fell extremely flat.
The only other "classic" I can remember that was more boring than Kill Bill is 2001.
 
@TonyTheLion well... im out!
 
I havent seen Reservoir Dogs
I should watch it
 
10:13 AM
@ScottW Dunno, I find both have terrible pacing, uninteresting characters, few to no memorable scenes, and long sequences of oh-my-god-what-is-happening-can-we-go-back-to-the-movie-I-was-enj-no-nevermind-I‌​-wasn't-enjoying-it-anyway.
@ScottW Well, since we found some common ground there, I can say that I find that 2001 suffers a lot on the same points.
 
@ScottW Usually, not much.
 
The only thing 2001 has there is memorable scenes.
 
@Borgleader <3 <3
 
@jaggedSpire its cold wear a hat
ok im off to work now
 
user1804599
> Sorry, server is full - try later
 
user1804599
10:18 AM
wtf freenode
 
user1804599
DoS maybe.
 
user1804599
@fredoverflow Is that not UB?
 
user1804599
15
Q: Is it undefined behaviour to memcpy from an uninitialized variable?

Tor KlingbergIs using an uninitialized variable as the src for memcpy undefined behaviour in C? void foo(int *to) { int from; memcpy(to, &from, sizeof(from)); }

 
How are a and b not initialized?
You know that the target comes first in memcpy, right?
 
user1804599
10:20 AM
x and y are not.
 
@Elyse It's memcpying into x and y.
 
user1804599
Oh wait, you're copying into x and y.
 
void * memcpy ( void * destination, const void * source, size_t num );
 
C lib functions follow the same visual order as in assignments.
@ScottW It's kinda funny because I enjoyed Clarke's book very much, but think the audiovisual rendition just didn't work well. And it's not even a matter of "sticking to the original"; since the screenplay and the book were developed together they are very similar (for the movie they picked Jupiter over Saturn for SFX reasons). It's really that I found the "boring sequences" work much better in the book.
 
@ScottW My favourite movie is Donnie Darko.
 
10:22 AM
@fredoverflow Doesn't account for NaNs, sadly.
 
You want different kinds of NaNs to be neighbours? I don't care!
 
donnie darko was alright
 
@fredoverflow No, your function makes them so.
 
my fav movie in highschool was fight club
 
user1804599
@R.MartinhoFernandes Never realised that. I did always realise it was the same order as x86-64 instructions, though!
 
10:23 AM
@R.MartinhoFernandes So you don't want NaNs to be neighbours?
 
The last 'mind fuck' movie I saw I liked was Triangle... anyone else seen it?
 
Any comparison involving NaNs should yield false.
 
I can see your point, but personally, I don't give a rat's ass about NaNs.
 
user1804599
@R.MartinhoFernandes Is isnan(x) considered a comparison?
 
10:25 AM
What's it compared with?
 
user1804599
NaN :')
 
yeah I didn't like it
 
@ScottW Hard to explain... group of friends set out on a boat. There's a storm, and they get shipwrecked but get picked up by an ocean liner. The liner is empty and spooky shenanigans follow
 
return x - y + 1 <= 2;   // best line of code I've written this week :)
 
@fredoverflow FWIW, it's easy to do it: find the smaller one, add 1 to it, and compare them for equality back as floats. Float comparison already does the right thing with NaNs :P
 
10:26 AM
If you like time loop movies that make you think its pretty good imo
 
@R.MartinhoFernandes Still won't work for +0.0 and -0.0 though ;)
 
Its not really a scary movie but its a good mix of creepy and bizarre: imdb.com/title/tt1187064/?ref_=fn_al_tt_1
 
I have TV to catch up with: Jessica Jones.
 
just watch Pixar stuff and live a happy life
 
Pixar movies are all the same. Incredibly good animation, solid laughs throughout, at least one deeply sad / emotional moment. They all have the same formula
 
10:30 AM
I cannot understand Loungers watching animated movies with happy endings.
 
@ScottW I saw the first one at the cinema and liked it. But I wouldn't watch it again.
 
You know you're not going to be disappointed... but you know you're nto going to be amazed
 
I was pretty amazed watching Inside Out vOv
 
@ScottW yeah he was great in john wick
 
10:32 AM
> Cfront, based on CPre, had a complete parser, symbol tables, and built a tree for each class, function, etc. Many of the obscure corner cases in C++ are related to the Cfront implementation limitations. The reason is that Cfront performed translation from C++ to C.
wat
 
I watched parts of this one incredibly fucked up movie with him in it though and I can't really shake him being the dude in that movie
I forgot what it was called
 
@fredoverflow lol, yeah, no?
 
no, antichrist
 
Hm, not even a handful of obvious bugs in a 100 KLOC project? Not bad, Bjarne, not bad at all!
 
i stopped watching it part way through
 
10:38 AM
@fredoverflow that their tool can catch :P
 
user1804599
@fredoverflow is purely functional programming difficult in Kotlin?
 
@R.MartinhoFernandes So what corner cases would that be, for example?
 
user1804599
Does Kotlin have do-notation?
 
Kotlin has no support for PFP at all. It doesn't even come with a persistent collections library.
 
user1804599
:(
 
user1804599
10:40 AM
Scala and Frege suck.
 
What's wrong with Frege?
 
user1804599
Laziness on the JVM is lol.
 
user1804599
Immutable collections are easy to implement though.
 
user1804599
> If you are happy with Scala, you probably don't need Kotlin.
 
user1804599
lol
 
user1804599
10:41 AM
From the official website.
 
@fredoverflow Yeah, I don't know. I can't think of single one that could be caused by implementation limitations that wasn't already inherited from C.
 
Right, because many people seem to have this misconception that Kotlin is a moder Scala or something. If anything, it's a "Scala--".
 
gn
 
user1804599
If Scala is Java++, and Kotlin is Scala--, what is C++--?
 
10:43 AM
D?
 
that's D
yeah
 
user1804599
How about Rust?
 
Haskell--
 
mmm; pred . succ /= id
 
user1804599
@ScarletAmaranth Why not?
 
10:44 AM
@Elyse C++-- == D
 
Because Kotlin /= Java
 
user1804599
It depends on the type class instance.
 
user1804599
oh :(
 
@Rapptz @Elyse I now correctly lex/parse my programming language and can generate an AST
how do I do semantical analysis from here?
 
user1804599
@orlp depends on the language.
 
10:45 AM
do I decorate the AST with typing, etc, etc, or do I generate a second AST, building from the first, that has all that information
or some other approach
 
@Elyse target language or compiler language?
 
7
Q: How do purely functional compilers annotate the AST with type info?

fredoverflowIn the syntax analysis phase, an imperative compiler can build an AST out of nodes that already contain a type field that is set to null during construction, and then later, in the semantic analysis phase, fill in the types by assigning the declared/inferred types into the type fields. How do pu...

 
user1804599
@fredoverflow I just add them as fields now:
 
user1804599
type 'a term =
    | Apply_term of 'a term * 'a term
    | Lambda_term of 'a * 'a term
    | Let_term of 'a * 'a term * 'a term
    | Variable_term of 'a

type 'a decl =
    | Let_decl of 'a * 'a term

type 'a modul = { name : string; decls : 'a decl list }
 
user1804599
10:47 AM
val type_module : Name.t Ast.modul -> (Name.t * t) Ast.modul
 
Freds guide to semantic analysis:
1. Read all about attribute grammars
2. Realize that compiler theory stops being useful after the lexer/parser phase
3. Forget all about attribute grammars
4. Use ad hoc PROGRAMMING for semantic analysis
 
user1804599
@orlp the language in which programs are written that are being analysed.
 
yeah, I'm not necessarily asking about type systems and academic stuff
my compiler is being written in C++
 
Semantic analysis without type systems?
 
I'm not saying that
I'm just saying that that is not the scope of my question
 
user1804599
10:50 AM
@fredoverflow Some untyped programming languages require semantic analysis.
 
can't you theoretically have an untyped programming language with const?
 
user1804599
For example, names must be in scope.
 
@orlp If all you're asking is whether you should add to the first tree or build a second tree, then the answer i yes.
 
and that I guess
 
user1804599
@orlp What is const?
 
10:51 AM
const x y = x
 
@Elyse that a variable may not change value
 
I prefer functional languages for parsers, and there I'd just write an AST transform.
 
maybe I don't properly understand untyped languages
 
user1804599
JavaScript is untyped and has immutable variables.
 
but say I have JavaBript, in which variables are not immutable
can't that have a const to say that a variable may not be mutated?
or would that make it no longer untyped?
 
user1804599
10:52 AM
That's an immutable variable.
 
@fredoverflow thanks mr. useful :P
 
Can you show us an example program that you would like to compile, so we can discuss your semantic analysis needs in a more concrete way?
@R.MartinhoFernandes What is "an AST transform" in detail?
 
@orlp In C++ I'd just attach the info onto the same AST.
@fredoverflow Just a Tree -> Tree function
Or tree parsers on ANTLR.
 
And where is the type information? Inside the Tree, or in an external map or something?
 
@fredoverflow I think I'd better show this
 
user1804599
10:55 AM
@R.MartinhoFernandes That doesn't indicate what information the tree contains.
 
user1804599
Using Maybe Type in all stages is out of the question.
 
This is what the parser poops out atm
 
@fredoverflow Oh well, more like (Tree a, Tree b) => a -> b, or even Tree a -> Tree b, i.e. not necessarily the same tree type.
 
(I don't have any operators specified, it's incredibly simple atm)
 
user1804599
10:55 AM
@orlp no boost::variant :(
 
@orlp Don't show us the compiler, show us an example program that you would like to feed to the compiler.
 
let's start really simple
{ 3 + 5 }
 
What is that, a database transaction?
 
one compound statement containing one statement containing one expression containing one addition of two numbers
 
@fredoverflow The second tree can even be type SecondTree = Tree (a, FirstTree) and share the first's nodes.
 
10:57 AM
let's say I want to add a type to the expression and the numbers
 
@R.MartinhoFernandes oh nice
 
user1804599
Walk the tree, keeping a map of (name, type) pairs.
 
@Elyse Why name? You mean expression?
 
@Elyse yes, but would I modify the original AST?
 
user1804599
@fredoverflow No. If I meant expression, I'd say "expression".
 
10:58 AM
as in, have some sort of optional type field in the Expr class?
 
@orlp That would certainly be simpler in C++. But there's no right answer to your question in general.
 
user1804599
@fredoverflow You need to keep track of types of variables.
 
@orlp That's certainly a feasible way. I would do it like that if I wrote my first compiler.
@Elyse I didn't know his language had variables.
 
@Elyse I think I'm going to implement some Scope class
 
user1804599
Well, if it doesn't have variables, you don't need to keep track of anything at all.
 

« first day (1868 days earlier)      last day (3082 days later) »