« first day (1617 days earlier)      last day (3333 days later) » 

user1804599
10:04 AM
> arguments => [map { resolve($_, { %$symbols }) } @{$ast->{arguments}}],
 
user1804599
absolutely gorgeous
 
user1804599
If I want to read a binary file in C++ with I/O streams, will it screw up the data with locale crap?
 
user1804599
I wouldn't be surprised if it did, but maybe that part has at least a little sanity in it.
 
Open in binary mode and use unformatted operations
 
user1804599
Will it not touch the data in any way?
 
10:11 AM
Not in any way that I know of.
 
user1804599
Maybe I'll use POCO.
 
user1804599
> Files are always opened in binary mode, a text mode with CR-LF translation is not supported.
 
user1804599
That's nice. Files contain only bytes.
 
Binary mode avoids "\r\n" <-> "\n" conversions and "eof character" issues on Windows, and unformatted I/O just reads bytes.
 
user1804599
Or I can finally add seeking to this and use it: github.com/rightfold/baka/blob/master/include/baka/io/… :P
 
10:15 AM
Wide uses binary mode for files
 
user1804599
Binary mode is the only sane mode for files.
 
yep
 
user1804599
Buffering and parsing must be done separately.
 
user1804599
They don't belong in the file I/O API.
 
@райтфолд Yeah. I never got that 'text mode' shit.
 
10:25 AM
shit is indeed it
 
user1804599
Alright, time to write code that writes bytecode.
 
@Puppy If there is going to be a text mode, there should be 'sound mode', 'video mode' and such madness.
 
user1804599
cuntsuck
 
user1804599
I need to store the module dependencies in the bytecode file in the correct order.
 
user1804599
Otherwise SIOF.
 
10:33 AM
why not just read the whole file and then run with the module dependencies?
 
Wel, here's an interesting question from a professional and/or enthusiast programmer:
http://stackoverflow.com/questions/29180656/why-whiletrue-is-an-infinite-loop
 
user1804599
@Puppy If module a begins with use b; use c;, then b's initialiser must be called before c's and c's before a's.
 
user1804599
The VM has to know that.
 
user1804599
Although I guess I can synthesise explicit calls to b::INIT and c::INIT in a::INIT instead.
 
that doesn't mean you can't load the whole file and look at the dependencies, instead of having to load them in order.
just load the whole file, then read the dependencies, then execute them
 
user1804599
10:36 AM
Yes, but the dependencies must be stored in that file.
 
user1804599
Otherwise it doesn't know what the dependencies are. :P
 
right, but it doesn't matter what order they're stored in
 
user1804599
It does, since otherwise they can't be initialised in the correct order.
 
because you can read the whole file before you even start.
@райтфолд Stored order != initialized order.
 
user1804599
That is extremely true.
 
10:37 AM
just load all the things, and then initialize all the things.
 
user1804599
The order has to be encoded in some way anyway.
 
sure, just put calls to b::init and c::init in a::init
 
user1804599
Yeah.
 
user1804599
That's more flexible.
 
wide and c++ both do that for member initialization
 
10:43 AM
TIL about sigstop.
 
you'll probably want to guard the init functions in case of multiple dependent modules
 
I can now pause processes.
 
also why do modules require static initializers?
 
@StackedCrooked SIGCONT!
 
yep
kill -SIGSTOP 10636 ; read ; kill -SIGCONT 10636
^ Quick test on Chrome
 
10:45 AM
IRTA SIGCUNT
 
I do this all the time. My CPU / GPU run hot pretty quickly. I sometimes just pkill -f -STOP john or similar to stop all worker processes
@StackedCrooked wut. you are aware that PIDs are not deterministic, let alone portable, right o.O
 
I looked up the pid first
 
Actually, many programs have interesting capabilities on other signals (SIGHUP, SIGUSR1 and SIGUSR2 are common)
@StackedCrooked I did that exactly once in my life. Then I graduated to pgrep/pkill and killall
 
I've been doing it all my life.
 
You, my friend, might have too much patience
 
10:49 AM
with occasional killall. or alt-sysrq-b if that didn't work
 
(IOW be not lazy enough)
 
> The SIGUSR1 and SIGUSR2 signals are set aside for you to use any way you want. They’re useful for simple interprocess communication, if you write a signal handler for them in the program that receives the signal.
 
@StackedCrooked Hahaha. As if alt-sysrq-b has anything todo with killall (killall -9 chrome is hella better than forcibly rebooting)
 
Using interrupts for IPC, interesting.
 
@StackedCrooked Many long-running tools (sdd, john, ntfsclone etc.) know how to print machine readable progress information to stdout when prompted.
 
10:51 AM
Can you pass data along with the signal?
 
alt-sysrq-k then first, or [alt-sysrq-s, alt-sysrq-u, alt-sysrq-r, alt-sysrq-b]
@StackedCrooked nope. it's a simple event
It's not for messaging. It's (surprise) for signalling
 
TIL how to signal my app.
 
> But why you upgrade the kernel? Kernel updates on stable distros are only security updates. Does you have fear to get a buffer overflow from a Local attacker? XD
WTH
 
> Does you
@StackedCrooked Two user defined signals, it's just enough to send "0" and "1"
Probably slowest IPC ever
 
Still cool.
 
user1804599
11:26 AM
Ok, awesome.
 
11:57 AM
@LucDanton so insightful and funny I have to reply saying so :P
 
user1804599
lol
 
user1804599
There was a program about islam on TV and it was directly followed by a commercial for an anti-islam political party.
 
user1804599
#   Failed test at t/Millc/ObjectBuilder.t line 14.
#          got: 'ޭ??'
#     expected: 'ޭ??'
 
user1804599
Yeah, terrific.
 
12:05 PM
Just discoverd I can do g++ main.cpp where main.cpp is a fifo.
This might be useful in coliru. The webserver would paste the user code into main.cpp and no startup cost for gcc.
Startup cost is minimal. So trick is useless. Probably..
 
user1804599
fatal: remote error:
  GitHub is offline for maintenance. See status.github.com for more info.
 
user1804599
nooooooooooooooo how can I push
 
All I get are pink unicorns. Screw them.
 
user1804599
why during the day, fools
 
user1804599
@StackedCrooked does POCO have stuff to decode binary data into integers? Like read<std::int32_t>(stream, little_endian);.
 
user1804599
12:11 PM
Or Boost perhaps. I never found a C++ library to do this simple fundamental thing.
 
It's easy to implement yourself actually.
 
user1804599
Yes, but I don't want to implement it myself.
 
user1804599
It's just std::memcpy and potential std::reverse but still.
 
btw, you can ignore endianness if you don't care for portability
just send PODs.
 
user1804599
This not being in Boost or std is just retarded.
 
user1804599
12:13 PM
It's such a common thing to do.
 
user1804599
 
Without length check:
 
user1804599
But the documentation is crap.
 
template<typename T>
T Decode(const uint8_t* data)     {
    static_assert(std::is_pod<T>::value, "");
    T t;
    memcpy(&t, data, sizeof(t));
    return t;
}
 
user1804599
You want char, not uint8_t.
 
user1804599
12:16 PM
Since you're reading bytes, not octets.
 
I give you permission to use char.
 
user1804599
Thanks.
 
user1804599
But I don't need it.
 
I always read octets.
This way I enforce the world to comply to 8-bit bytes.
 
user1804599
I wrote something like this once.
 
12:19 PM
There's always boost serialization.
Or boost fusion.
 
user1804599
I doubt that library exposes the function I need.
 
user1804599
Since Boost puts all the useful stuff in detail namespaces.
 
What are you trying to achieve? Sending and receiving pods?
Or more than that...!?
 
user1804599
I have a Perl program that writes files with binary data.
 
user1804599
I want to read those files in C++ and decode the data.
 
12:22 PM
Do you know the exact layout of what you will be reading? Or do you need a way to detect it?
 
user1804599
I know the layout.
 
user1804599
It's a magic number, a version number, a list of strings and a list of functions.
 
user1804599
    "\xDE\xAD\xBE\xEF" . # magic
    "\x00\x00\x00\x00\x01\x00" . # version
    "\x02\x00\x00\x00" . # string count
    "\x03\x00\x00\x00foo" .
    "\x03\x00\x00\x00bar"
 
Might want to include a checksum.
 
user1804599
Yeah, I put that at the end of the file.
 
12:24 PM
32-bit length field per string?
 
user1804599
Or maybe at the beginning. I don't know.
 
user1804599
@StackedCrooked Yeah.
 
user1804599
This isn't MSVC.
 
You could use a system like the http headers.
 
user1804599
Why would I complicate it?
 
12:25 PM
For fun.
 
user1804599
I could put the binary decoding stuff in my I/O library.
 
user1804599
The functions could take readers.
 
If you use newline separators the you can parse with readline.
 
user1804599
template<typename T, typename Reader>
T read_integer<T>(Reader& reader, ByteOrder byteOrder) { … }
 
user1804599
@StackedCrooked What if strings contain newlines?
 
12:28 PM
Then you are fucked.
 
user1804599
lol
 
user1804599
Alright.
 
@ScarletAmaranth Didn’t you use that to your advantage in proofs, theorems, etc.? Writing "the solution is x + 2kπ for k in Z" gets old fast.
 
user1804599
template<typename T, typename Reader>
T read_integer<T>(Reader& reader, byte_order bo) {
    std::array<char, sizeof(T)> data;
    read_full(reader, data.data(), data.data() + data.size());
    if (bo != byte_order::native) {
        std::reverse(data.begin(), data.end());
    }
    T result;
    std::memcpy(&result, data.data(), sizeof(T));
    return result;
}
 
user1804599
@StackedCrooked This is what I want.
 
12:32 PM
There's a portable way to avoid the byte order check.
a[0] << 3 | a[1] << 2 | a[2] << 1 | a[3]
 
user1804599
You can do it with bitshifts, but I find this more readable and the bitshift method is difficult to generalise to all integer types.
 
Or something like that.
 
user1804599
The only protocol I know of that doesn't use big or little endian is RuneScape's which uses middle endian.
 
RuneScape is wtf
 
user1804599
enum class byte_order { big_endian, little_endian, network = big_endian, native = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? little_endian : big_endian };. :3
 
12:36 PM
Plenty of results if I google "mod[ulo] 2π" or "mod[ulo] 2pi", I knew I didn’t just make it up.
 
@milleniumbug people still play runescape!? o.o
 
HAHA Chrome can't handle Unicode on Mac warning will crash chrome on a mac.
 
I use a NetEncoded<T> for 16/32-bit header fields. It provides operator T() which performs the network-to-host conversion. Then I can just memcpy the network data and rely on the type system to take care of the rest.
 
user1804599
@StackedCrooked I prefer to decode my data immediately after I read it.
 
I use it for both encoding and decoding.
But do as you wish.
 
user1804599
12:40 PM
Alright, let's add those things to Baka.
 
user1804599
Seeking is easiest to implement on null streams since it's just a no-op.
 
Saw this talk by Joe Armstrong yesterday. It was pretty interesting.
 
user1804599
 
Yep. I have nearly identical code.
 
where I download libcurl for dev c++ ???
 
12:47 PM
@Axeem lol libcurl
@Axeem lol Dev-C++
 
@Axeem dev-c++ is bad software. don't use it.
 
what is best ?
 
user1804599
Vim, Z shell and clang.
 
@Axeem There's no best. There are bad and worse.
 
Qt Creator is pretty good. Eclipse is also popular. On Windows Visual Studio is best.
 
12:50 PM
I want to use curl how can I include it ?
 
Dunno.
 
I wonder how NetBeans works with C++
It works quite well with Java
 
for Windows I like Code::Blocks.
 
@Veritas Tried, didn't like it.
 
user1804599
 
12:57 PM
I used it when I first started learning. Nowadays I mostly do stuff on my linux partition so not sure how it's doing lately.
 
1:15 PM
Default NetBeans project includes by default <cstdlib> and adds using namespace std; and return 0; in main()
So bad
 
user1804599
return 0; in main is good.
 
user1804599
<cstdlib> is useful for std::size_t but shouldn't be added by default IMO.
 
It's redundant.
 
user1804599
So what?
 
user1804599
It being optional is a retarded language feature which is best ignored.
 
1:17 PM
Oh wait, it's also in <cstdlib> (since C++11) <---- lol
 
user1804599
Oh <cstdlib>.
 
user1804599
Lol, <cstdlib>.
 
@milleniumbug beat me to it
 
user1804599
I always include <cstdlib> for std::size_t.
 
I use <cstddef>
oh wait
-facepalm-
ignore this
 
user1804599
1:19 PM
@Veritas Yes, me too.
 
user1804599
I never use <cstdlib>.
 
dafuq is #include_next
 
ah alright it's the right one
 
Oh, it's an GCC extension
 
yes
 
@milleniumbug How can such a type even exist?
 
Wait, why now this needs to be said? What does this prohibit that was legal before?
@StackedCrooked Don't know.
 
Infinite data structures a la Haskell, perhaps.
 
then again isn't std::size_t defined so it can represent the size of all possible objects?
 
@Veritas That's my point.
 
1:27 PM
@milleniumbug yes it absolutely means that.
because AWS (address windowing extensions) break this
 
Xeo
@StackedCrooked char foo[std::numeric_limits<std::size_T>::max()+1]; :D
 
I could via page mapping, allocate an object that cannot be held in my current address window all at once
 
@Xeo how, it looks totally innocent :D
 
Xeo
Actually, that would overflow and make an array of size 0, wouldn't it.
 
Actually, that could unlock God mode.
 
Xeo
1:29 PM
int foo[<that stuff>]; would work better
@StackedCrooked those are built through indirection
 
using a = std::array<char, std::numeric_limits<std::size_t>::max()>;
using b = std::array<a, 2>;
 
that would probably work
well it would work as in it would release demons
 
> error: type 'std::array<char, 18446744073709551615ul>' is too large
It no longer detects at compile-time if you actually go over size_t.
 
Xeo
(had to make it -O0 so it doesn't remove the unused variable)
 
user1804599
How should I chose my opcodes?
 
user1804599
1:38 PM
I think I'll just number them starting at 1 and increment that when I add a new one.
 
user1804599
Without any intuitive grouping.
 
Don't fret on that yet.
I have used enumerators with 10-step increments.
I was nervous about it and wanted to enable inserting new ones later.
 
Mmmh didn’t Andrew Sutton have a repo with a concept library?
 
user1804599
Ok, now I have the binary representation of the hello world program.
 
1:54 PM
Hi, I asked a question on SO 10 minutes ago and still no one has answered. What should I do?
 
@Elvisjames Delete it
 
But I really need the answer
 
@Elvisjames It's been up for 10 minutes and nobody has answered. Obviously nobody is going to, so delete it.
 
@Elvisjames Wait. If you don't get an answer, deal with it.
 
..or you could wait 24 hours until SO contributors around the world have had a chance to answer it.
@Elvisjames Orite. You were actually serious?
 
1:58 PM
@LucDanton that's why I appreciate the insight :)
 
I mean, you were REALLY serious about it? 10 minutes?
 
Yes, I was in a hurry.
 
@Elvisjames Why would we prioritize your question above anyone else's? Don't come here for that.
 
facepalm
 
@MartinJames do you dare imply his question is not above everyone else's? how rude... :P
 
2:06 PM
What algorithm do you follow when answering questions?
shortest first
oldest first
or just random
or anything else
 
In other news - SDL2 is still retarded with its #define main SDL_main business.
 
@Elvisjames Well, knowing the answer helps, of course:)
 
I have made a wonderful discovery about the conjunction of Haskell and Unicode. http://t.co/kQRpXjAYQ8
Thoughts?..
 
@Unihedro thought: oh ffs not another haskellite =/
 
@Borgleader Thanks!
 
2:11 PM
@Unihedro explain like i'm a normal human being who doesn't know haskell
 
@Blob map function written with hieroglyphs.
 
@LucDanton you have too much time on your hands
 
user1804599
@Unihedro Bad code.
 
user1804599
2:21 PM
Good code is written in English, not in weird ancient Egyptian languages.
 
@Unihedro That's a map
 
user1804599
@Unihedro I suppose it's not fmap because functors didn't exist back then?
 
user1804599
They barely knew about geometry. Let alone category theory.
 
2:34 PM
it's fmap but they only knew about lifting then, so it was actually called liftToList
 
It's map not an fmap
 
@райтфолд category theory? is that a silly way of saying "set theory"?
oh wait it's a thing
 
gg
 
user1804599
Alright, bytecode writing works.
 
user1804599
Now code generation.
 
2:38 PM
What are you working on nowadays rightfold?
 
user1804599
Mill compiler.
 
Where's the specification of Mill?
 
user1804599
In my head.
 
why do I prefer small font size when writing imperative code and large font size for functional :-/?
 
user1804599
@ScarletAmaranth To use the same amount of screen space.
 
2:41 PM
@ScarletAmaranth you can't bear looking at too much functional code at the same time?
 
@ScarletAmaranth It should be the other way around. SHOUT YOUR ORDERS!
 
user1804599
@Jefffrey Here's the compiler so you can see how it's implemented: github.com/mill-lang/mill/tree/develop/millc
 
@Jefffrey MIL-STD-0800-PANTOONA
 
.pm?
 
Perl Module
And let's talk about porn. If you are a guy you make $40k/yr, while if you are a woman you make $120k/yr FOR THE SAME JOB!
 
2:52 PM
@Jefffrey Stop it
 
WHERE'S YOUR ANITA SARKEESIAN NOW
 
Does anyone know what a non-binding witness means?
 
@Jefffrey Also, if they're doing "the same job", I would say they're doing it wrong.
 
I can't find the definition online.
 
Sorry $250k/yr not $120k/yr
holy shit
 
2:59 PM
eehm
"up to"
 
most actually earn very little
 
@Jefffrey Looking for a new job I see ;)
 
@Nooble lol
 
user1804599
3:16 PM
Yay.
 
user1804599
Codegen works.
 
good morning, anybody working on anything fun?
 
Nope.
 
user1804599
@Mikhail Yes!
 
What is up with the hate towards javascript? I see it everywhere.
3
It is not like there is an alternative anyways
 
3:23 PM
There are pseudo-alternatives.
TypeScript, CoffeScript, other languages that compile to JS.
And of course, there are people who underestimate web development.
 
user1804599
Web development is terrible regardless of JavaScript alternative.
 
@райтфолд Why is that?
Better than doing "commercial" Java or C# development. Non-client side development is pretty challenging actually
 
Wheres the robot i need ninja advice :(
 
The robot has been summoned.
 
3:28 PM
@R.MartinhoFernandes oh hi, how was your BSG game?
 
The Cylons destroyed Galactica.
 
did they suspect you of being a cylon for no reason again? (ISTR that happening to you in a previous game)
 
Oh, no, they did not.
Endgame. (I still haven't finished all the painting)
 
oh sweet, those are your miniatures right? :)
 
:22222222 JS poorly conforms to expectations about classes and structure, you need to learn myriads of tricks to get it to do what you want. The real way to avoid JS is move code to the backend.
 
3:32 PM
Yeah.
 
user1804599
Alright, time to write a VM. /cc @sehe
 
casual saturday
implemented a vm
took a walk
> Luke Skywalker was an angry young male from the desert, who was indoctrinated by a religious fringe member, and joined a terror plot to blow up a major military instillation.
 
@Borgleader oh and you cannot see all the minis in that pic because a lot of them were blown up and are out of the board.
 
@Mikhail What about ECMAScript 6?
 
user1804599
Also terrible.
 
3:42 PM
@R.MartinhoFernandes how many did you make in total?
 
user1804599
Also, classes in JS are very easy.
 
Besides, moving workload to the server means losing scalability
 
@Borgleader I just painted them. They come with the game.
 
oh ok
 
It's some 30 or so total.
 
3:44 PM
@райтфолд How terrible can it be?
 
user1804599
Even PHP is more pleasant to program in than JavaScript is.
 
PFHFHFHFHF
 
user1804599
What part of my VM to implement first.
 
@райтфолд Give me a good reason why JS sucks.
 
@khajvah operator == is a first and obvious one
 
user1804599
3:45 PM
I guess decoding the object files is a good start.
 
@R.MartinhoFernandes how come python bootstrap.py && ninja invokes the default target but
python boostrap.py
ninja build.ninja
 
user1804599
@khajvah it's a composition of bad design decisions.
 
doesn't
 
ninja takes targets as argument, not files.
 
@milleniumbug Cmon, you can't claim that just because you don't like it.
 
3:46 PM
ohhhhhhhhhhhhhhhh
=.=; i feel so dumb now
 
@khajvah Why? Of course I can.
 
@райтфолд That was a really really good reason, good job.
 
@khajvah Operator == is literally Hitler.
 
@milleniumbug Just use ===. Dang.
 
Hmm. I deauthorized my SSH key on this machine.
Ooops.
 
user1804599
3:48 PM
Just a few of these bad design decisions: lack of operator overloading, lack of function argument count checking, silent failure of OOB array access and non-existent object property access, maps keys are checked for object identity, making them useless or hard to use in lots of cases, lack of variable declaration implicitly creates a property on the global object rather than failing.
 
user1804599
And, most importantly, special cases are everywhere in the language and the libraries people write. Key example is Array(1) vs Array(1, 2).
 
user1804599
@milleniumbug The guy in that picture is literally Hitler.
 
What? Will a picture serve as a counter argument?
 
user1804599
Also, that swastika is really weird.
 
3:53 PM
@райтфолд 1. Not a big deal, I don't need it for client side development, 2. I agree but that is not a big deal either. 3. It is supposed to work on a browser, you wouldn't want it to break all the website just because wrong object access. 4.what? 5. It is a language feature.
 
@milleniumbug is this a joke on "claiming something you dont like" i.e. claim land vs claim a fact?
 
user1804599
@khajvah Bullshit.
 
@райтфолд which part buddy
 
user1804599
All errors should prevent the page from showing up.
 
It's running on the client, it's his problem now :P
 
3:55 PM
we should make a FF plugin that refuses to render incorrect websites. start a movement.
 
@райтфолд No, there are huge websites that shouldn't break down just because one number is not displayed
 
user1804599
I can't pick a programming language to write my VM in.
 
@райтфолд javascript
 
@райтфолд Haskell
 
@райтфолд MIT Scheme?
 
user1804599
3:56 PM
C++ it is.
 
@райтфолд D
 
user1804599
Has anyone used bdec?
 
@райтфолд no what is it?
lazy solution is cpickle right?
 

« first day (1617 days earlier)      last day (3333 days later) »