« first day (1281 days earlier)      last day (3669 days later) » 

7:00 PM
plus you get karma :D:D:D:D
 
ok, now you can totally fuck off back to whatever pit you came from.
 
that would be grim
 
@SuperCookie47 If reading the documentation of LLVM is already too much for you, I promise you that you will never be able to write your own compiler.
 
who said it was too much for me?
 
> reading requires effort
3
 
7:03 PM
i get lost beneath tons among tons of terms that are relative to other terms which are specific to this and that andeventually rely on knowledge of the thing your researching.
 
user1804599
@SuperCookie47 If you do not want to put effort into anything, don’t expect any effort from us. Get out.
 
it means nothing to me
 
@SuperCookie47 it seems you have depleted your annual reserve of karma in this room, yes
 
I DON'T NEED KARAM >)
 
user1804599
 
7:04 PM
will i ever be welcome back... :(
2
 
ok, let me rephrase that.
go away or I'll just summon the local moderator who seems to believe that people like you don't exist and he'll get rid of you.
 
@SuperCookie47 it requires experience. And there's only one way to get it. Come back to the main site when you are stuck somewhere in the middle of your actual attempts at implementing this stuff. Otherwise you're just wasting your time.
 
So, after updating to Ubuntu 14.04 I have lost the ability to connect my Canon camera or my Android phone and have Thunar see/mount the offered storage.
Thoughts?
 
Time to delve into book after book I guess, when I could find it 20,000,000 times faster here.
I don't know how else to refine a question
 
7:06 PM
Your question has already been answered multiple times.
 
user1804599
I don’t need KARAM. I need HAREM.
 
Not definitely
 
@DeadMG to be fair, he hasn't been bad. He just doesn't realize he's wasting time and doesn't know when to stop. It's human to keep trying in the same direction if there's the appearance of progress. Even if everybody is telling you it's fake progress.
 
@SuperCookie47 Well, if your goal is minimal, look at Turbo Pascal. They didn't even need syntax trees.
 
Thank you @sehe
 
7:08 PM
So they went straight source code -> tokens -> machine code.
That's the absolute minimum you gotta have.
 
I admit, I should have stopped at some point
 
END OF DISCUSSION
 
But I feel unstasfied and without direction :(
 
user1804599
North.
 
Especially regarding LLVM
 
7:08 PM
If I were you, I would screw compilers and start with a simple interpreter of math expressions.
 
@SuperCookie47 when will you realize that that's simply not true? You can find it on the main site with the proper targeted question. And yes, that will even get you karma
@SuperCookie47 ah. That's okay. And a fair excuse. You turn out to be human. I like that
 
If you can parse 2*3+4*5 correctly and print out the result, you will get an adrenaline rush like having had sex with three virgins at the same time.
Then take the next step.
 
@FredOverflow Not really… not that much.
 
user1804599
Time to write a video game.
 
@FredOverflow I would much rather have sex with one experienced goddess, really
 
7:10 PM
Don't rush into building a multi-platform optimizing compiler for a full-blown programming language as complicated as C. You will fail and give up.
 
@rightfold chip chip, your compiler cannot get be finished
 
user1804599
Interpreter.
 
@FredOverflow "If you can parse 2*3+4*5 correctly and print out the result, you will get an adrenaline rush like having had sex with three virgins at the same time." I had to LOL
 
You're like those people who want to write the next World of Warcraft, when they haven't even finished something as simple as Tic Tac Toe, Pong or Mario.
 
user1804599
It was too boring.
 
user1804599
7:11 PM
And “Pijpslet” was a bad name for a programming language.
 
But how do you mean parse?
As in calculate in vb.net and output from a function?
assuming i create a scripting language (interpreter)
 
Sure, write a function that takes a string (the formular "2*3+4*5") and returns an int (the result of the computation).
This will already take about 100 lines of code.
 
user1804599
10 SLOC in Haskell.
 
but that's a scripting language which i am pretty sure i could do. i want to start out with a compiled language right off the bat..
 
Is What you end up doing when you want to evaluate those expressions. Go on, get started. You can Google and search Stack Overflow first if you really want. You'll see what parsing is in a jiffy.
 
7:13 PM
@SuperCookie47 no you dont
 
@rightfold S?
 
user1804599
Yes, S.
 
user1804599
Congratulations. You can read.
 
You don't know that. Maybe he just copy/pasted.
13
Q: Writing my own C++ compiler

chester89I want to write my own c++ compiler in c++. Let´s say I´m going to build it in VS. The main idea is that it must have been able to compile itself, which means I cannot use STL, boost, etc. libraries, can I? So, does it mean that I must do everything from scratch - from lexical analyser to binary ...

lol
 
@rightfold Ok, let me spell the question out for ya: what does S stand for, there?
 
7:14 PM
@SuperCookie47 I want to be rich instantaneously. But it fails to happen almost every day.
 
user1804599
Looking for a challenge, huh? We already have decent C++ compilers. Go cure cancer instead. — Paul Beckingham Feb 22 '09 at 20:13
 
user1804599
I like this one. Don’t fix what isn’t broken.
 
user1804599
@Jefffrey S stands for “source.”
 
Thanks, brainyfold
 
It's commenters and 'answerers' like this I can't stand: "Looking for a challenge, huh? We already have decent C++ compilers. Go cure cancer instead."
He is obviously not doing this to implement C++. He is using that as a base language to learn how to parse and compile manually
 
7:15 PM
@SuperCookie47 snide remarks are what comments are for
 
That's all I've got when asking questions. except for here
 
@SuperCookie47 He should start with an interpreter
compilers are crazy hard
 
but these comments are 1- discouraging 2-not helpful 3-annoying
 
i've read some...
hahha
it's intimidating
 
7:17 PM
Principles of Compiler Design, by Alfred Aho and Jeffrey D. Ullman, is a classic textbook on compilers for computer programming languages. It is often called the "dragon book" and its cover depicts a knight and a dragon in battle; the dragon is green, and labelled "Complexity of Compiler Construction", while the knight wields a lance labeled "LALR parser generator". The book may be called the "green dragon book" to distinguish it from its successor, Aho, Sethi & Ullman's ', which is the "red dragon book". The second edition of ' added a fourth author, Monica S. Lam, and the dragon beca...
 
@FredOverflow Part 1 is not really a part
 
Turbo Pascal being the language..?
 
@SuperCookie47 How does "I want to write my own c++ compiler in c++." mean anything else than "I want to write my own c++ compiler in c++."?
 
@FredOverflow by replacing OP's goals with SuperCookie's ones
 
put it this way. who else is the comment for but him, and if it's for him, all you are doing is discouraging him, not helping him, and ultimately just wasting his time really
 
7:20 PM
@SuperCookie47 Who do you mean by "you"?
None of us Loungers commented on that question.
 
German mann
:)
 
I didn't choose to be German. Nobody asked me!
 
You're German?
 
many loungers are
 
7:21 PM
Coincidental
But convenient
 
user1804599
@SuperCookie47 Actually.
 
user1804599
Discouraging him is the opposite of wasting his time.
 
yeah I couldn't agree more
 
Depending on your opinion
 
user1804599
It’s my opinion, which is correct.
 
7:26 PM
xD
 
Not every time.
 
@SuperCookie47 If you didn't want to waste your own time, you would start on that math interpreter right away.
If it is as simple and trivial as you think, show us the result in 1-2 hours.
 
@SuperCookie47 maybe this is repeating, but why do you want to write your own language (or compiler?)
 
Just for the fun.
Let's hear it, come on
 
@sehe Hehe, I could not say it better. :)
 
7:32 PM
who was it that said they'd created their own language before?
 
@rightfold it's a marvelous name for the right language. If it sucks a lot, then a blow-slut is an apt description
 
user1804599
lol
 
@MooingDuck Interpreters are compilers, too. And even if you're doing execution-from-AST, which is shit, you still need to implement a lot of what makes a compiler (p much only skipping codegen)
 
@sehe You must be doing it wrong :)
 
user1804599
namespace Pijpslet was just too meh.
 
7:34 PM
@CatPlusPlus "And even if you're doing execution-from-AST, which is shit" - LOL
 
I've finally configured backups :toot:
 
@CatPlusPlus That's why I am collecting information about code gen now rather than later
it will save me time
 
@MooingDuck mmm. depends. If you don't do optimization whatsoever, it can be a modest effort beyond interpreting
 
and would then be able to expand my language gradually
 
@sehe yeah, I was thinking of optimization. I should have said optimization is crazy hard
 
7:36 PM
i could always optimize the source code first
as an extra help
 
@MooingDuck That's just maths. Yeah, they're often crazy hard.
 
There are some trivial opts you can do
 
which would make it easier to parse
 
Like constant folding
 
@SuperCookie47 Wait. That's optimizing the grammar. That's not an optimization. That's a simplification
 
user1804599
7:37 PM
TCO is not very difficult either.
 
But it's not that important for prototyping a language
 
@CatPlusPlus true
 
put it this way. would this work as a compiler:
- opt. source code (replace duplicate decl. etc., variable names?)
- parse source code and generate tokens
- from tokens generate AST
- from AST generate C++ code
- compile C++
as a starting point?
 
user1804599
It depends on the programming language.
 
as in..
 
user1804599
7:38 PM
If you want static typing, for example, you need an extra analysis step.
 
C++ is a crappy target, because you have to account for all the UB and other C++-specific shit
 
user1804599
Declaration syntax. :D
 
Target an existing VM
Like CLR/Mono or JVM
 
user1804599
@CatPlusPlus He doesn’t want to target a VM lol.
 
Or LLVM I guess if you want to deal with linking issues
 
7:39 PM
native codegen?
 
if i target llvm, will i be able to compile for anything?
that's what i am looking
 
afaik, you can, but not completely
 
user1804599
If you target Perl, all you need to do is prepend use MyLanguage::Runtime; to the source code and write some Perl code yourself. :P
 
Don't do native codegen
 
user1804599
@CatPlusPlus You can generate LLVM assembly code and pass that to the LLVM assembler or to clang.
 
7:41 PM
Linking is still shit in LLVM
Don't do native codegen, it's not worth it
 
again, my goal is for this langauge to be platform independant, and execute quickly (i.e. compiled)
 
user1804599
@SuperCookie47 So use JVM.
 
i am avoiding native code gen
JVM?
 
user1804599
JVM works on many platforms and executes code quickly.
 
would it work for example on arduino cpu?
FOR EXAMPLE
 
user1804599
 
or microprocessor i should say
 
is your target the arduino?
 
user1804599
Apparently.
 
"EXAMPLE"
C++ can be compiled to it..
so i want the same portability
i have no specific target platform
 
user1804599
I would not worry about code generation right now.
 
user1804599
7:44 PM
Write a parser and a semantic analyser (if required) first.
 
if i can generate an AST, I'll be happy
 
I don't think JVM has wider target platform
 
Where can I ask questions about functional programming?
 
from there, can i code gen?
 
specifically scheme
 
user1804599
7:44 PM
@ReutSharabani on Stack Overflow
 
@ReutSharabani to rightfold
 
user1804599

Functional Programming

Laughing at mutability!
 
Xeo
@ReutSharabani In the Functional Programming room or... Stack Overflow?
 
@rightfold I'm blocked on stack overflow, for some reason they think my former questinos weren't productive enough...
 
user1804599
If you cannot ask decent questions on Stack Overflow, don’t expect to be able to ask them in chat either.
 
7:46 PM
?
can you go from AST to code gen
 
Yes but it costs 5000$
 
i'm afraid i don't get it
seriously tho
 
user1804599
@SuperCookie47 It depends on the programming language.
 
how so?
 
user1804599
If you need to resolve names statically or check type statically, you need an extra step between parsing and code generation.
 
7:48 PM
@SuperCookie47 Every book on compilers will tell you how a compiler works. Just start reading one of them, and keep reading. And more importantly, try the things out. Not at the end of the book, but at the end of each chapter, or even at the end of each page.
 
as in you need to go back to re-analyze, now that you need to verify something (i.e. something's type, compatibility?
isn't that semantics?
 
You cannot design a grand plan of a compiler and then expect to write it down in one session without hitting a brick wall.
@SuperCookie47 Do you want a language without semantics?
 
but i mean, do you mean semantics should be analyzed after AST generation?
 
of course
Any compiler book will tell you that.
 
user1804599
@SuperCookie47 Yes, if necessary.
 
7:52 PM
what about a pre-ast semantics analysis?
 
user1804599
Some simple languages (like JavaScript, AFAIK) don’t need an extra analysis step, though.
 
So these processes are pretty much language-specific, and are pretty much open to everyone
 
user1804599
Yes.
 
there's no absolute rule
 
as in depending on the language you may need to repeat steps up to 5 times?
or more
 
7:53 PM
@SuperCookie47 How do you expect to check if the expression on the right-hand side of an assignment matches the type on the left-hand side before you even know that you are dealing with an assignment?
 
user1804599
For most assembly languages, you’d have an abstract syntax list, not an abstract syntax tree, lol.
 
list vs tree
what/'s the difference as far as the compiler is concerned
won't it be read the same way?
 
You think too much. Just jump in the water already.
 
@FredOverflow But it's cold like Cat++'s heart D:
 
Then jump in the fire.
 
7:55 PM
because expression, right off the bat, in my, language must be <expression> := <string>
| <int>
| <arith_expression>
| <identifier>
| <expression> <op> <expression>
;)
 
like 1 := int?
 
OK. Thank you you guys, for your help :)
I will leave you in piece
 
nevermind
 
operater procedures?
 
@juanchopanza It is my understanding that the reference is implicitly const - unless you would have marked the lambda as mutable :) But you knew that, right o.O — sehe 4 mins ago
 
7:56 PM
these are rules, not the actual procedures
 
operator precedence
 
as in which to process first?
 
Like how do you express that * binds tighter than +? Your grammar doesn't express that.
 
@SuperCookie47 why is <arith_expression> its own production? Wouldn't 80% of that be covered under <expr> <op> <expr>?!
 
that will be after verification of the grammar, i.e. that it follows the rules
oops
 
7:57 PM
ok
 
i removed <arith_expression> earlier
(the definition of it)
i forgot to remove it from there
@FredOverflow how would i define that in the text file?
that's all that is for now
a rule list
how would i express that * binds tighter than +?
 
@SuperCookie47 Any tutorial on recursive descent parsers will tell you that.
 
@SuperCookie47 lel
 
lel..
 
[yawn] tht was a nice nap. I'm refreshed, invigorated. Time for a shower, then out round the town pubs to, (verbally), molest any Chelsea supporters that have crept out from under their stones.
 
8:00 PM
@Martin lolo
a.k.a lol
 
you can edit your messages
 
ino
but meh
OK, well I've got a compiler to write
 
> ino
 
Not before losing 20lb and going bald of course
 
7
A: How to verify algebraic statements using boost::spirit?

seheThe simplest thing that could work, if you ask me would be http://liveworkspace.org/code/1fvc8x$0 equation = (expression >> "=" >> expression) [ _val = _1 == _2 ]; This will parse two expressions, and the returned attribute is a bool that indicates whether both expressions evaluated to the sam...

 
8:01 PM
@SuperCookie47 Keep us updated on your progress.
 
I'll try
I might not make it though
xD
Wish me luck
 
I edited mine twice - it's difficult to type when still laughing at Chelski's rubbish performance against the dead Mackems.
 
@SuperCookie47 That sample I linked is not "basic" as in - Boost Spirit is quite advanced. But [the code] clearly shows how the grammar productions bind the operators in the right order of precedence
 
I will not be using boost or c++ to write my compiler
it's vb.net for testing purposes
as the first language
 
Ah. You're testing VB.Net. What a noble cause.
Someone's gotta do it.
 
8:04 PM
lol
it's all i know
know*
 
seriously now, you can edit your own messages. do it!
 
@SuperCookie47 (do look at the grammar productions, though: Lines 20-38)
 
Things I learned today: Bacula is fucking complicated, finding working helper scripts for operating a private CA is impossible
 
@Jefffrey I concur. SuperCookie is using 70% of vertical screen estate
 
tax it
 
8:05 PM
@CatPlusPlus TinyCA2
@Jefffrey ETOOSHORT
 
See, I found TinyCA but it was dead
 
Compiler-writing time
Thanks for the help guys
I'll update if anything fun happens (it won't)
 
@CatPlusPlus Not on my box. Am I in for a surprise? The UI sucks a bit, but it's better than doing things manually. And I still have the same "database" as in ~2001
 
Peace out
 
Nite!
 
8:07 PM
This gun' be interesting
 
@sehe I mean project page etc
 
@CatPlusPlus Oh well. Who needs it :|
 
It's useful to get the thing from
:v
 
apt-get install tinyca2 - boom. It's python, so it's effec
 
I could use something that works on Windows, I don't want to store CA key online
Oh well, later
Seems like Perl
 
8:09 PM
@CatPlusPlus It's Python.
 
And also it has "use POSIX" in it
 
Mmm. I might have misremembered then
 
Maybe I'll just generate self-signed wildcards and not do the CA dance
Tomorrow, maybe. Can't be too productive in a single day
 
8:26 PM
@Angew Ah. I'd almost say /WHY/, but I remembered: c++ :) — sehe 13 secs ago
 
user1804599
lol, this is funny
 
user1804599
console.log(that) if 42 // logs 42
 
why is that funny? Is // somehow integer division or sumtin'?
 
user1804599
// starts a comment.
 
oh. wow. That's funny
 
8:35 PM
@sehe it's postfix if notation
 
user1804599
@sehe Yup, that’s funny.
 
@Jefffrey well, I didn't ask about that :)
 
user1804599
It is equivalent to if (that = 42) console.log(that);.
 
is that = 42 assignment there?
 
user1804599
Yes.
 
8:37 PM
Because if not, that's pretty nifty syntax.
 
@sehe I know, but if you assimilate that you can see that // is the beginning of a comment :)
 
Where does the assignment to that happen in your sample/
 
user1804599
You can use that to refer to the result of the condition.
 
@Jefffrey No. Because I didn't. Of course, the comment assumption was the first thing, but then I failed to see the funny, so I started to look for plausible misinterpretations
 
user1804599
This is only useful in languages where conditions need not be Booleans, of course.
 
8:38 PM
@rightfold Ah. that's the part I was forgetting
 
It's not funny, it's sad. :(
 
So the thing making it unfunny was in fact the comment. It made it all so tautological that I missed the thing you were trying to show
 
wait a second; so that is a keyword?
 
a builtin var, more
 
@StackedCrooked confirmed; Marika / Marie is a cunt
 
8:41 PM
More importantly, she posesses one
 
user1804599
lol, LiveScript has logical xor.
 
user1804599
Hmm.
 
Seems interesting:
"Idris is a much simpler language than Haskell," - @puffnfresh Also more consistent / unifying! #lambdaconf http://t.co/iodVVTHj4y
@rightfold just use != (assuming strong bools)
 
user1804599
@sehe Well, actually I like the idea.
 
user1804599
Semantics.
 
8:43 PM
Me too.
 
what I mean is: how do the interpreter/compiler knows, in console.log(x) if expr, if expr should be shoved into x or not?
 
user1804599
that is special.
 
6 mins ago, by sehe
@rightfold Ah. that's the part I was forgetting
 
user1804599
@sehe Well, it doesn’t translate to != because of weak typing. :P
 
> assuming strong bools
 
user1804599
8:45 PM
x xor y translates to !x !== !y && (x || y).
 
user1804599
Which seems silly to me; !x != !y works as well.
 
user1804599
Oh, wait. I think I know why they did this.
 
user1804599
To be consistent with x || y and x && y not necessarily returning Booleans.
 
null/undef
 
user1804599
LiveScript is like syntax gone wild.
 
user1804599
8:48 PM
It has syntax for everything.
 
I'll gladly surrender your nice operator in exchange for proper typinh
 
user1804599
Like accessignment: up-case-name = (.name .= to-upper-case!).
 
user1804599
Oh and f! is f()!
 
@rightfold what else can they return? :/
 
whatever is in there
 
user1804599
8:49 PM
@Jefffrey the first true-ish value, for example.
 
1 || true => 1?
 
yes
 
that seems fucked up
 
nope; welcome to dynamic typing.
 
user1804599
> 1 || 2 || 0
1
> 0 || 0 || 2 || 4
2
> true && true && false
false
> true && 0 && true
0
 
user1804599
8:50 PM
@Jefffrey It’s extremely useful.
 
user1804599
@sehe s/dynamic/weak/
 
okay, I was thinking Perl/js
 
user1804599
or in Clojure does this as well.
 
user1804599
user=> (or nil nil false 42)
42
 
@Jefffrey it's the same as the x or y thing in Lua and Ruby.
 
user1804599
8:52 PM
Also fuck JavaScript for lacking ||=.
 
or php and any shell scripts
 
user1804599
No, not PHP.
 
user1804599
PHP, being terrible, actually returns Booleans from || and &&.
 
o.O I thought PHP "derived" all that from Perl :(
 
@rightfold how?
 
user1804599
8:53 PM
The only thing PHP derived from Perl were sigils and bare words.
 
@Jefffrey You can say var value = param || "default" etc.
 
user1804599
@Jefffrey x = foo or some-default
 
I think Jeffrey forgot about other languages he uses
 
@Rapptz or and and are weird, || and && also work like that
but yeah, I can see what ya'll talking about
 
user1804599
I used this in Hexapoda 50.0 in Clojure: (or (validate-issue input) (insert-issue (->Issue (:title input) (:body input)))) where validate-issue returns a set of validation errors or nil on no error.
 
8:56 PM
I don't understand weak typing anymore, unfortunately
 
@Rapptz I think we can confirm this, right after you tell us who your imaginary friend, named Jeffrey, is :)
 
stupid SFINAE/overload resolution bug
 
static && strong typing are so useful
 
user1804599
I’m still not sure how macros work in Clojure, though.
 
weakly typed languages seems so... unsafe
 

« first day (1281 days earlier)      last day (3669 days later) »