« first day (1830 days earlier)      last day (3119 days later) » 

user1804599
6:00 PM
oh cool
 
user1804599
GHC runtime system sometimes detects infinite loops and optimises them to not busyloop.
 
lel, fucking autorelease pools in my rendering loop.
 
Ell
 
@Ell Your cast is incorrect. You need to & the specific member, not cast the pointer.
 
Ell
6:10 PM
@Puppy which line? the one in main?
 
yep
 
Ell
Why?
 
because you're assuming that the base is always at offset 0 of the parent.
 
Ell
Oh I see
I didn't know C could even do pointer to members
 
...
it's not a pointer-to-member in the C++ sense.
it's just a pointer, to an object that happens to be contained in another object.
 
Ell
6:16 PM
what does "pointer to member" mean in the c++ sense?
 
it's basically a function that takes a T* and produces a U*, where U is the type of the member.
so it's more like an offset from this to this->obj rather than a genuine pointer.
 
Ell
Oh right I see
 
and I should also mention that it's worthless and shit.
 
Ell
This looks so fugly. I don't mind the vtables n that being ugly but I want this to be somewhat less ugly at the point of use
 
pointer-to-members are shit
 
Ell
6:18 PM
I might just make get_number take a void* and make the constraint that inherited must be first
 
better to just define a function that makes the call.
what you've just suggested is tremendously unsafe.
 
Ell
@Puppy how would that work?
you can't overload in c can you? I'm not sure how else it'd work
 
you can't
but it doesn't matter
ah wait, I see you've already done it with get_number.
 
Ell
yeah
 
that's fine, there's only a few function implementations you need to do like that and the caller is no worse than any other C function.
 
Ell
6:21 PM
but that can only take a parent*, so I need to add casts everywhere I want to use get_number
 
like I said, take the address of the member instead of doing the cast.
 
Ell
ie, I want this: coliru.stacked-crooked.com/a/b1f3f0d78a03f83c without the void*
Ohhhhh
I understand now
thanks :)
 
user406009
You can also legally cast &c to parent*.
 
you can do, but it's a stupid idea
 
guys, who here thinks he's better at discussions than me?
 
6:25 PM
everybody.
8
 
user406009
Depends on the goal of the discussion.
 
Okay. Question 2. Who'd be willing to review a discussion I had and see if I've made any mistakes, was wrong, insulting or otherwise problematic?
 
everybody.
 
s/every/no/
 
It takes effort. I doubt that
 
user406009
6:26 PM
@BartekBanachewicz As a third party, you tend to be correct most of the time. The other side simply doesn't care enough to argue well.
 
link it and we'll see what happens
 

"Stop Teaching C" debate

2 hours ago, 2 hours 2 minutes total – 164 messages, 6 users, 2 stars

Bookmarked 14 secs ago by Bartek Banachewicz

 
@BartekBanachewicz I've been through it and the worst you've done is a little snark. The other guy seems to be waffling on about completely unrelated stuff.
 
user406009
DrorK's arguments do not make any sense.
 
Good. Instead of calling him a retard, I actually focused on what he said. I'm getting slightly better at this
thanks guys.
 
user406009
6:32 PM
DrorK actually seems to be arguing about a completely different topic.
 
user406009
DrorK is arguing that C++ is unnessary.
 
user406009
You and the video are arguing that if you want to teach C++, don't teach C first.
 
user406009
Those are completely different topics.
 
user406009
Truthfully, the "C++ is unnecessary" does have a certain degree of validity.
 
not really.
 
user406009
6:34 PM
The argument usually goes that most tasks do not need that level of performance.
 
user406009
Therefore, most programmers don't need to know C++.
 
Which is kind of true.
Most of the world manages with Java, PHP and Javascript nowadays.
 
my preference for C++ has nothing to do with performance.
 
OTOH I don't remember you actually having much choice to make that preference.
 
Not worth it, Puppy. Bratek has intensified.
 
6:35 PM
@BartekBanachewicz How do you mean?
 
@Puppy Or at least, your experience with C++ is vastly bigger than with any other language.
Experience => Confidence, IMHO. Confidence makes for preference.
 
I made a free choice to learn C++
 
Oh of course.
 
my first actual language was Lua
and I could certainly have stuck with that or chosen to learn something like it, like JS or Python perhaps
 
But once you've gained significant experience in C++, any other language you know might be less likely to be used by you.
And let's face it, Lua and C++ aren't really competing in what they're used for.
 
6:37 PM
Who cares about performance anyway? It's such a waste of time. Computers are fast, just make it work and be done with it. Doesn't matter if the algorithm is exponential time.
25
What the fuck did I just say?
 
--- Mysticial, 2015.
 
@Mysticial faints
 
user406009
@Mysticial We are talking about constant time ratios of 10-100X at worst.
 
user406009
I really don't care that much if my email takes an extra second to load.
 
user406009
And you can even get that ratio down to ~2 if you are careful and use something like Java or C#.
 
6:39 PM
@Lalaland for that network is the problem anyway
 
@Mysticial For some algorithms, it certainly doesn't. I'm pretty sure I wrote an exponential time algorithm today. It just only applies to ~10 items at worst.
 
if it takes a second to load, I'm p sure the 900ms out of it is waiting for network.
 
@Mysticial the truth :P
 
@Mysticial being serious though, battery life directly corresponds to the number of ops done.
 
user406009
@BartekBanachewicz 90% of the time, I am plugged in and don't care about battery life.
 
6:41 PM
@BartekBanachewicz I cannot spot a battery responsible for supporting the CPU in my PC
 
so we have 2 opinions out of billions of people using mobile devices.
 
@Lalaland That must be pretty nasty. I use my phone almost exclusively on the go.
 
2 certainly valid ones, but still.
 
@BartekBanachewicz true... but then I think we have bigger fish to fry than what sort algorithm people are using :P
 
I have a desktop which I work at, and I have a phone which I basically never use when plugged in because what the fuck would even be the point.
 
6:42 PM
@Puppy s/g/lo/
 
@thecoshman he he he
 
Never in my life have I heard anyone who matters answer "performance" when asked why they use C++. And Bartek just keeps pounding that dead horse, right in the ass.
 
@ElimGarak Speekin' da troof
 
Ell
@BartekBanachewicz +1 to this
performance stopped being so important when we could keep getting cpus faster
but now that everyone is mobile, performance is important again for reasons of battery life
 
user406009
What are the other main C++ arguments?
1. C API binding.
2. Direct memory usage.
3. Destructors
4. C++ libraries
 
6:44 PM
I don't think that's true
 
No
 
performance is a serious concern now.
but just not for most people like us ;p
 
Ell
@Puppy right yeah, it's a concern
but the solutions are different
well, kinda not :L
 
Moore's Law hasn't made lag obsolete
 
6:45 PM
@Lalaland 1. is way too common, 2. as well. 3. is an actual argument. 4. is sort of meh but ok.
 
but let's face it, for most people, most of the time, it is ;p
 
Ell
but there was a period where upgrading hardware was cheaper than hiring more developers/better developers
 
@Ell It still is - much cheaper.
@Lalaland 1 and 2 don't give a shit. 3 important. 4 somewhat important depends on field.
 
@BartekBanachewicz well, more the deterministic nature of C++ destructors
 
you can't make slow code fast with a hardware upgrade
 
user1804599
6:46 PM
in C can you do this?
 
no, but you can make it fast enough
 
@StackedCrooked compiler upgrades though...
 
user1804599
// TU 1:
void f();
void g() { f(42); }

// TU 2:
void f(int x) { printf("%d\n", x); } // prints 42 when g is called
 
Ell
@Puppy but I mean, it's no longer a solution for certain applications
ie phones
 
If it's slow then you spin up more AWS instances
 
6:47 PM
it never was a solution in those cases.
 
yeah for a phone to make it faster means to make it more power intensive
 
@Elyse I think so, yes
 
@StackedCrooked shhh, we're trying to sell faster hardware silly
 
you're measuring the solution in Watt-Hours, not seconds :P
 
6:47 PM
but in recent years even then it's become less true that it's not a solution
 
Ell
there are loads'a these
 
@BartekBanachewicz silly you, upgrade the hardware, the battery :P
 
@Elyse yes
 
user1804599
Awesome!
 
@BartekBanachewicz same thing
 
6:51 PM
Days since last Bartek incident: 0.
 
@BartekBanachewicz To the extent they do, it's by depending (heavily) on software that's already written in other languages--mostly C and C++ (with a few bits of assembly language thrown in here and there). It's undoubtedly true that you don't particularly need (or often even benefit from) C++ for the GUI of your CRUD app (for example). At the same time, without the underpinngings, the rest wouldn't work either.
 
Recently there is a debate between me & my friend about variable initialization in C++.
 
@JerryCoffin oh sure. But you only need a handful of people to make those underpinnings.
 
consider the simple statement int a=int(3);
friend says that above statement creates a temporary variable & copy initialized it.
 
@BartekBanachewicz Well, that's not true at all. Windows and Linux are pretty big pieces of software.
@PravasiMeet I says, piss off vampire
 
7:00 PM
How many people maintain Linux? 100? 150?
 
user1804599
Thousands.
 
But I am not agree with him & believe that both int a=3; & int a=int(3) are same?
 
@Elyse let's say 5000.
 
I honestly don't know, but I'll certainly agree that it's a lot higher than it genuinely needs to be.
 
@Puppy: It would be better if you clear this confusion.
 
7:01 PM
lol
 
That's still laughably small compared to number of developers building on top of linux
that's kinda the point of abstractions.
 
@PravasiMeet It would be better if you left.
 
@Puppy: why?
 
A few people make an abstraction that can then be used by a lot of people.
@PravasiMeet define "the same"
 
@BartekBanachewicz That's true; but they also don't build on top of Linux alone. They also build on top of innumerable compilers, linkers, debuggers, windowing libraries, etc.
although I would concede that quite a few of those do not have any requirement to be written in C or performance equivalent.
 
7:02 PM
@Puppy Which, residing in the userspace land, don't need C and kernel knowledge.
 
@BartekBanachewicz: what kind of question is this?
 
@Puppy exactly
 
well
I would argue that some of them do.
 
@PravasiMeet you said "the same" but you didn't clarify what you mean. By my definition of "the same", they are not the same because one spells int twice and the other once.
 
it's hard to author a compiler if you can't handle register allocation, and it's hard to author a debugger if you can't get down with stack frames and stack pointers.
 
7:03 PM
@BartekBanachewicz hehe
 
that's obviously not kernel level but it's no C# either.
 
@BartekBanachewicz: did you mean both are different ?
 
@Puppy compilers and debuggers still make the minority of the programs.
@PravasiMeet I meant: depends on what you consider "different".
 
yep.
 
@BartekBanachewicz: how?
 
7:04 PM
for the record I fully agree with you that there are way more people building on top.
 
@PravasiMeet one has int written once and the other has int written twice.
I only classify things by the number of times they have int inside.
 
does this int a=int(3); indeed creates a temporary variable?
 
This is a completely different question.
 
I'm just saying that it's more than a handful, and they need to be pretty cream of the crop to make sure everything that is built on top of them keeps working (assuming that you don't just throw 5x more manpower that you need at the problem because you're a moron, Linux)
 
@BartekBanachewicz Why are you arguing with that trell?
 
7:05 PM
@BartekBanachewicz: then what different it makes that one has int written once and the other has int written twice?
 
@PravasiMeet Fuck if I know.
 
@JerryCoffin: what is ur opinion sir?
@BartekBanachewicz: what nonsense is this?
 
Just plonk the fucker
 
personally
 
7:07 PM
I had to build Wide in C++ because LLVM and Clang don't really offer any bindings to any other language
the fact that I was also highly experienced in C++ was mostly orthogonal
although on the other hand
 
@Puppy wow, really?
 
let's face it, when I started building Wide I wanted to mutate types with imperative code at compile-time, in the module I was compiling.
boy I'm glad I never got around to doing that because what the fuck was I even thinking.
 
@Puppy: that question is still unsolved
 
the difference is irrelevant because the semantics are the same here
 
7:10 PM
let's see
 
I mean this was 2 minutes of googling
not a well-condoned research
 
LLVM 3.5.1, actually not sure, LLVM 3.3, LLVM 3.6
that rust binding looks super dodgy because it's built against the Rust compiler, so you're tied to them with both hands and feet, and not sure wat u gonna do if you need Clang bindings.
 
@Puppy llvmpy was deprecated in favor of llvmlite, which is 3.6.2
 
@JerryCoffin: Sir, it would be better if you answer it.
 
let alone half the dodgy shit Wide has to do with the Clang internals to function.
 
Ell
7:12 PM
@Puppy hey thats what I want to do ;)
 
although fairly, that's really just because Clang is shit rather than any fault of anybody binding their APIs.
 
Ell
Oh wait no it's not
 
oh dear.
they built Clang# against libclang?
well that's gonna be ... unusable.
 
Ell
@Puppy cathedral vs bazaar
 
@BartekBanachewicz That is a little more impressive.
although I'm looking at their documentation and about 90% of the API seems to be completely missing.
 
7:20 PM
in C, 1 hour ago, by Dror K.
@BartekBanachewicz People with years of C experience, try to learn C++, and give up on it. The issue is obviously with C++, not with the order of how you're learning it
lol
 
Funny thing about abstractions and building on top of Linux
 
@Jefffrey yeah the guy's pretty silly
 
in C, 1 hour ago, by Dror K.
Two groups of people experiencing the same issue. And yet you convince yourself that the solution to the issue- lies with something that is valid to only one of the groups... that makes no sense
 
A slowly rising Next Big Thing is unikernels
I.e. operating system as a library
Oh my DigitalOcean implemented rebindable IPs
 
not sure what I would use an operating system as a library for
 
7:24 PM
For getting rid of the abstractions
 
Ell
> Unikernels are specialised, single address space machine images constructed by using library operating systems.
 
For databases that do their own informed I/O scheduling
 
and then?
ah I see
 
For network things that skip the entire TCP/IP stack and just throw preformatted packets directly into the NIC
 
@BartekBanachewicz It's funny cause that discussion is 90% not about the original topic but rather misunderstanding.
 
7:25 PM
For complete VMs that boot in microseconds
 
Ell
like wot @StackedCrooked does
he skips linux tcp dunne?
 
Shaving off layers is kinda fun
I'm still on the "make my containers smaller" stage
 
does win8 cache things in ram
 
Is your mum huge?
 
Every OS caches things in RAM
 
7:30 PM
otherwise I can't explain why it sits at 6GB/8 with all processes not adding up to that
 
The answer to those two questions is the same
 
That's what RAM is for
 
user1804599
I'm so confuzzled.
 
6.8/8 now because firefox went bazooka
 
OS-level cache existed for like decades
 
7:31 PM
Are you pawnguyed?
 
@CatPlusPlus I see
I could have sworn this was the first time I had this kind of usage
 
Ell
how do you build an application with mirage then?
what apis do yo use if there is no kernel api?
> MirageOS uses the OCaml language, with libraries that provide networking, storage and concurrency support that work under Unix during development, but become operating system drivers when being compiled for production deployment.
owait
 
I should fire up a game and see how the thing adapts
 
7:36 PM
@AlexM. Well that's actively used memory then, not cache
 
I don't know why because the memory used by each process added does not add up to that
 
Once the system needs more memory, it starts dumping the warmstart data (used to reopen closed applications faster), then moves to general cache. Don't worry about it too much, but you can always download more RAM if you need (:P).
 
That's all cache memory though, not the used one
Committed things may get swapped out if they're not used
Cache is generally just freed
@AlexM. Are you running any VMs
 
nope
 
Driver-allocated memory is not necessarily listed as belonging to any process
 
7:41 PM
Yeah, also, to understand how your memory footprint is formed when you can't account for the usual suspects, look up a bit about superfetch (as it is now called).
 
it just went to 7.6/8 now that I'm running HoMM VI lol
 
Prepare for OOM killer
 
I'm literally just running firefox, steam and the game
 
Windows doesn't handle memory pressure very well
90%+ is when things go to shit
 
Hey Cat, where's Nomic's forum?
 
7:42 PM
Yeah, it really crumbles over 80-90. I prefer to keep it at 70% at the most. Beyond that, it starts acting all weird and shit.
 
Nowhere
 
Oh
Shall we organize a new game of Nomic? @R.MartinhoFernandes
 
Oh, gawd, the unnecessary gore in Gotham.
 
lol I got it to 97%
wtf
 
Right now I feel like the Cat from the Red Dwarf. I just had a nap before the big night sleep.
 
7:49 PM
@AlexM. You need to download more memory.
 
it could be a driver leaking
 
Ell
I wonder how difficult threading is in C
I need a thread for ui and one for backgrund
 
Ell
yeah, I know :(
 
imagine manual memory management and then make it a million times worse.
 
7:53 PM
no thread-ready primitives
no async primitives
no way to build them
 
best you can do is just use some library that's already done it.
 
Before I migrated my Pi program to C++, I had my own thread library that wrapped either pthreads or WinAPI.
It's still there actually. But deprecated in favor of the task-based parallelism API.
 
TBB?
 

« first day (1830 days earlier)      last day (3119 days later) »