« first day (1861 days earlier)      last day (3311 days later) » 

16:00
@Ven so mature == good?
@CatPlusPlus for the monet
Ven
Ven
@LoïcFaure-Lacroix syllogism much?
prolog is a quite mature language...
Wait, I just realized Prolog is French.
@StackedCrooked Monet is a great painter indeed
16:02
I'd do mobile for him.
@Ven "The Glorious Default"
Ell
Ell
Lord who puts 4 coaches on a weekend train
so I have a Source object that stores source code (normalized with encoding/line endings), the filename and the source code as a vector of lines
Ell
Ell
#packed #ridiculous #CrossCountry
16:05
should I std::shared_ptr the big members (source code and lines)
or should I pass Source around in std::shared_ptr instead
Ven
Ven
@Griwes That could be a neat boat name
I hate search engines that don't understand "C++" is a real search string.
Dont shared_ptr anything would be my advicw
I'm dead
Yeah. shared_ptr paves a slow way to hell.
why?
16:08
In threaded/async code I still use them with weak pointer.
I need to pass around this Source object, and copying it all over the place is drama (memory usage)
@orlp They undermine ownership.
@R.MartinhoFernandes NOOOOOOOOOOOOO
no one 'owns' the source code, they all just read the same source
the source code however must stay alive as an object as long as some object is reading it
Won't a reference do?
16:09
how is that not shared ownership?
@R.MartinhoFernandes then no one owns the source code and it will just die
Er no
Whoever passes it along owns it
Er no
@orlp Pass by ref. If you need to move it, move it.
Rather than giving out a pointer it might be better to give out an id. This way you don't lose control.
@EtiennedeMartel it doesn't move
...he doesn't have a single place where it could be moved in.
16:11
Depends heavily on the context though.
@orlp Then wherever it is owns it.
uggh
nvm
you guys are cargo culting against shared_ptr
the ownership is shared
it's the right thing to do
@orlp You keep telling us your use case is not shared ownership and then you double down on shared pointers.
You'll join us soon enough.
Not from your description.
16:11
youtube interrupts your video in the middle to show you ads
@Mr.kbok adblock
From what you tell us, I can guarantee that your ref count is never gonna go higher than 1.
An unexpected cycle can really shatter your confidence.
@TonyTheLion BUT IMMORAL
@StackedCrooked there are no cycles
it's just shared_ptr to strings
16:12
acuaely cba instal
That's what I thought.
@Mr.kbok well, choices...
SharedPtr has its uses. It's just that I'm currently in a period where my like for them is declining.
Still don't see how you'd need to share that in a compiler.
So, either you're not explaining your problem very well, or you found a solution before you even knew what the problem was.
16:13
@R.MartinhoFernandes because I don't have a strict hierarchy in which the lexer owns the parser or vice versa
the lexer holds a reference to the source code, so does the parser, and so will other parts of the program (semantic analyzer, etc)
The driver owns both
@orlp At one point someone will have to own the parser and the lexer and etc.
Something somewhere will be a root.
Why not have that thing also own the source?
Okay. So KevinC was just stringing me along, just to say "ok, but all that (obviously) doesn't apply". Yeah. Well. I've tried.
16:15
struct compiler
{
	lexer l;
	parser p;
	analyzer a;
	source s;
};
source = read_source();
tokens = lex(source);
ast = parse(tokens);
code = codegen(ast);
// ...
I really don't see the problem
@sehe Yeah, I didn't really feel like he wanted actual opinions, just validation that he was right.
ok, so now the driver will pass errors with context referring to the source upwards
Why share ownership if you can pin it on the stack
16:16
@orlp Heh? Errors can have references to the source.
What's upwards from the driver
@CatPlusPlus whoever wanted to compile something
That's the driver
@EtiennedeMartel Is that the guy about his book? (That I happen to have plonked yesterday, he seemed annoying)
some CLI, an API, etc
16:16
@Borgleader Yep.
@CatPlusPlus A compiler is a library.
There will always be an API.
@orlp Whoever loaded the source owns the source. That should be the root of your hierarchy.
The driver can can return everything.
vOv
(Unless you are RMS and think compiler-as-library hurts your freedom...)
@EtiennedeMartel no, the source is loaded inside the compiler
Ven
Ven
16:17
@CatPlusPlus it's all fun and games until you want macros :P
the binary blob that forms the source can be passed as a filename, stream or memory
if the raison d'etre for an object is its higher layer users then a refcount seems fitting
the source is interpreted from that binary blob inside the compiler though
Yes, and only its product needs to hold on to stuff...
This is a problem you're creating for yourself so I guess enjoy the shared_ptr solution?
16:18
but then my original, unanswered question remains
Being a sensible API doing a thing completely is "creating problems for yourself"? Eh.
It's components don't need to hold on to something that is pinned on the stack above.
shared_ptr<Source> or struct Source { shared_ptr<string> code; }
I guess this is why we don't have nice APIs.
@orlp neither vOv
16:19
can you please stop and just discuss my question?
I could also ask "I have some shared resource X inside an object O"
@Griwes lol sensible
I feel like you've designed an architecture that makes it very hard to determine who owns what, and instead of refactoring that into something that doesn't shoots itself in the foot, you've decided that hacking everything together with shared ownership is the better idea.
use an intrusive nullptr
yeah
I can't because the context makes it pointless
16:20
but I guess you wouldn't understand what a sensible API is.
You like C#, after all.
That's... relevant
@orlp you could rephrase it as such but then you'd get "it depends" answers.
then tell me what it depends on
16:21
+1 for literally having me waiting years before someone comes up with that. Thanks man! — polemon Nov 8 at 16:08
shared_ptr<O> vs struct O { shared_ptr<X> x; }
It depends on what O is and how it will be used...
I can feel the hate pervading this room.
Good.
@orlp TBH this is really not a situation where shared_pr comes to mind.
A "do everything for me the way you want" is a useless API for compiler
16:22
Crush your enemies with "No."s and "lol"s.
Calling gcc is that API
Sensible API for the compiler is where you're the driver
@StackedCrooked isn't this exactly the same as copy-on-write strings, just knowing in advance that that write will never come?
In which case you own the things driver should own and there is literally no problem with this
Okay, so Cat is RMS.
What the fuck are you even talking about
16:23
Root Mean Square?
Enough with these fucking acronyms
@orlp no, because you can know where Source will be needed.
jesus fucking christ lounge discussions dot fucking txt
A COW string is a general purpose tool
@R.MartinhoFernandes why specialize if a general purpose tool works?
requires more mental thought
"Compiler as a library is bad because reasons" followed by nonsensical reasons is something both Stallman and Cat did.
16:24
Because the specialisation is simpler.
shared_ptr is lazy.
NOBODY SAID THAT YOU IDIOT
Using a shared pointer is saying "I don't give a shit"
@CatPlusPlus shrug and move on
Is English skill in here really so fucking bad
Do I have to translate into something else
16:25
Cat and Griwes should not be allowed in the same room.
@CatPlusPlus naw
The Clash of the Polish
@CatPlusPlus You might start with saying sensible things.
@TonyTheLion It has nothing to do with that stop memefying this nonsense
@Griwes How do you fucking infer "compiler as a library is bad" from "having one 'do everything' API call is bad API for a compiler"
Can you like use punctuation please It makes it really hard to understand your messages if you don't Thanks
16:26
It takes special level of being bad at reading
Ell
Ell
@CatPlusPlus you are both polish: V
@CatPlusPlus "Never favour writing over reading"
Master API design, the API that doesn't let you control anything, good fucking job
That's so sensible
~~~~~
christ
I'm gonna go grab a pizza or something
This is awesome
You said that gcc is the "compiler" api, and that in any other cases an api doing a complete thing is retarded.
16:27
@CatPlusPlus sounds like a good idea
@CatPlusPlus something sounds promising
@Griwes no, that's not what he said.
So you are somehow fine with lexer, parser, whatever being a complete api, but not with the compiler in its entirety, for no reasons.
No I haven't said "gcc is the 'compiler' API" I said it's the same kind of API that proposed 'do everything for me the way you want' call
Stop it now. You misunderstood it.
16:28
It's literally identical
@Griwes you’re more off the mark than usual
@CatPlusPlus ...that's what I said you said.
@Griwes Got an axe to grind today?
No, it's not and only you think it is.
You're really good at API design
inb4 that shitty 'omg ad homimemnss'
Ugh
16:29
lol
Yeah, fine. Keep cargo culting against semantics that make sense in certain situations (this being one of them).
Off to the fucking ignore bucket
What
No I don't care
hey hey hey, I put up with enough stupid shit at work, I don't need your crap here too
"don't shared_ptr" <- that
"cargo culting", those words again.
16:30
@orlp I wouldn't put in a shared_ptr something I can pin on the stack, and I don't see how you can't do it in this case. That's essentially it.
@CatPlusPlus Yes you do
That's the reason why you are invested in this
Making a case for it => cargo culting.
@R.MartinhoFernandes my problem is that right now, yes, I can pin it on the stack
@R.MartinhoFernandes Someone who instantly goes into a "us vs them" stance isn't someone I want to have a discussion with.
Don't let him have the last word
16:30
No, you didn't make a case for it.
Lounge<stupid>
but so far none of these objects depend on eachother in any way, and function fully standalone
You said "your api is bad because it allows a use that justifies shared_ptr".
user406009
@thecoshman That's sorta implied by the Lounge<C++> as C++ is stupid.
16:31
I'll keep discuasing it with orlp then. He's listening to my "cargo culting"
Bye Poles
user406009
@thecoshman In other words, the Lounge is covariant.
eh, fuck it
@R.MartinhoFernandes ergh, now I'll have to hear cat moan about it on IRC
as soon as I introduce some 'master' that's supposed to hold a resource they require I've imposed a lifetime diagram
ITT Robot doesn't want to dance with Poles. i.e. he doesn't like Pole dancing.
16:32
IRC #loungecpp is still a thing?
(Man I stretched that a bit far)
keep in mind that all of this is simply an optimization
no one 'owns' the resource
@orlp I really thinks someone should.
value semantics would work too, if not for memory usage
@Jefery ofc, irc doesn't die
16:33
In C++ you have to think long and hard about who owns what.
@EtiennedeMartel but truly, no one owns the source code, or they all do
@EtiennedeMartel toddler programming, you own everything!
user406009
@EtiennedeMartel You sometimes have to do that in other languages as well.
That's what passing stack stuff by ref is for
irc is not dead guys
user406009
16:33
Even with garbage collection, you still have ownership for resources like files.
it still has a vibrant community
They don't own it, they have it as input.
@orlp Someone needs to own it, and then that someone can pass refs to those who need it.
Ok, that one was bad.
@EtiennedeMartel all right I'll give that a go then
16:34
Let's see what's going on in there
@EtiennedeMartel Does the vector own the list or the deque.. Arg so confusing
@StackedCrooked Nobody in their right mind uses list or deque.
user1804599
@TonyTheLion to keep posting what??
If you depend on something then you should own it.
Or stop depending on it :D
@StackedCrooked but that's opposite to what etienne suggested me
unless you consider a reference owning something
user1804599
16:37
Stop considering memory a resource by simulating unlimitedness of it with a tracing GC, and many problems are immediately solved.
user1804599
Then it's time to move on to important stuff!
@orlp do you depend on that reference?
@thecoshman define depend
user406009
@Elyse What about non-memory resources?
user406009
Like files, or database connections, or whatever?
16:38
does the object break if that reference dies? the answer to that is yes
That's the idea with maintaining hierarchies.
user406009
@Elyse Actually, I guess the counterargument is that those "other" types of resources are much more rare.
A child can safely depend on what its parent owns.
user406009
Solve the big problems first.
(It doesn't have to a be a tree, by the way. It could be scopes)
Ell
Ell
16:39
If someone laughs at you, just own it
IOW a stack
If scope B is contained in scope A, then scope B can safely depend on what is in scope A.
@milleniumbug Exactly that.
@EtiennedeMartel yes, but nowhere in the definition of the object is it encoded in a safe way that it will always be this way
user1804599
@Lalaland they're rare and tend not to be a problem even if you manage them manually (e.g. with try–finally/bracket) or pseudo-manually (e.g. with).
e.g. nowhere is there any safety check or automatic check that whoever passed the Source to Lexer is keeping Source alive
16:41
Whoever passes you a ref has to make sure it lasts longer than you.
@EtiennedeMartel would you call this... manual?
@orlp That's an issue of documentation.
@orlp arguments survive the whole execution implictly
...manual memory management?
@EtiennedeMartel so is all lifetime
the whole point of automatic memory management is not having to document what needs to be kept alive
instead, have the code do it correctly automatically simply by specifying the correct interface
Ell
Ell
Unless threading is involved :V
user406009
16:44
@orlp Have you looked into Rust? It seems like you would find it's lifetime stuff quite interesting.
@Lalaland of course I have
and while I do not agree with rusts' implementation
This would suck in Rust.
I find that the concept of explicit lifetimes to be one of the biggest recent advances in programming langauge design
Ell
Ell
Recent?
user406009
@orlp Some would say that explicit lifetimes are a failure.
16:46
@Ell anything within the last 10 years is recent in my book when it comes to computing/CS/programming
user406009
They increase programming complexity while offering only minimal benefits over a GC.
@Lalaland I said the concept of
it's a (to my knowledge) relatively new idea
@Lalaland static guarantees are not a minimal benefit
If I obtain an IP via DHCP then do I own it? Or does the DHCP server?
the idea will be explored further, and I believe you can make a system that nearly always infers the correct lifetime
Ell
Ell
16:47
Unless I misunderstand "explicit lifetimes"
user406009
@LucDanton People have different priorities.
user1804599
@StackedCrooked What does "owning an IP" mean?
Ell
Ell
Explicit lifetimes are before 10 years
user406009
There is a reason why dynamic programming languages have their niche.
@Lalaland right; so make a more precise claim
Ell
Ell
16:47
@StackedCrooked you don't own it, DHCP is a lease
user1804599
Rust is a nice DSL for programs that can't afford a GC.
@Ell I've never seen it before rust
maybe I've just had my head stuck up my arse
@Lalaland I'd say they are to GC what static typing is to dynamic typing
I suppose they are just numbers in the local subnet range.
Ell
Ell
I do misunderstand it then :V
user1804599
16:48
Which are quite few, so Rust has quite few use-cases.
Ell
Ell
You own a lease to an IP
user406009
@orlp The problem is that there is a big divide between academia and practice.
@Elyse I think rust is a pretty good kernel language, no?
Ell
Ell
And when the lease is up you own nout
@Lalaland keep in mind that I'm 21
I haven't had much time to watch developments nor much time to live
16:49
You have cancer?
@R.MartinhoFernandes no, "I haven't had much time to live"
user1804599
@R.MartinhoFernandes I do!
e.g. I've only had 21 years so far
of which the first 10 can be quite easily shown to be effectively useless
user1804599
so 11 years of time to explore stuff
user1804599
16:50
@orlp What kind of kernel?
@Elyse dno, linux kernel?
for example
low-level security sensitive code in general
user1804599
I don't know much about the Linux kernel.
user5020521
the jed is down this is the link to check currentlydown.com/extensions.joomla.org
@Elyse nasa stuff also comes to mind
@Elyse It's an OS. Like Windows Vista.
16:51
in cases where you simply have no margin for error
projects in which you'd wish for a --really-fucking-pedantic-warn-me-about-everything flag
@StackedCrooked A kernel is an OS? That doesn't seem right.
user5020521
could you please check if it works in your country?
user1804599
@orlp No margin for error? Use a language in which you can prove theorems about your programs.
@Elyse well.. there's a problem for that
writing a specific, exact and correct specification is no easier than writing a specific, exact and correct implementation for the vast majority of problems
@Elyse although I definitely believe such a language/tool could be tremendously helpful in some areas
user1804599
Lack of nontermination (i.e. infinite loops and exceptions) is already a nice guarantee.
16:54
@Elyse rebecca.blackfriday
Everything terminates at some point :)
@Elyse obligatory but muh halting problem
(obviously that doesn't apply in the vast majority of cases)
I'm falling asleep on the sofa
@R.MartinhoFernandes move over to the bed
undress
masturbate
and then continue chatting until asleep
Ell
Ell
I'm falling asleep on the train
user1804599
16:55
@orlp The halting problem is easy for programs which are guaranteed to always terminate.
My girlfriend is on the way. No need for that.
user1804599
The catch is that some terminating programs cannot be expressed in such languages.
Ell
Ell
@Jefery no, OS is other stuff + kernel, eg GNU/Linux is a popular OS
@Elyse Such as?
user1804599
16:56
@Jefery Depends on the language.
HTML programs
user1804599
Of course, such a language can always make exceptions for specific algorithms known to terminate.
there I solved computar science
std::terminate <--- solved the halting problem :)
16:57
this is a cool talk
But a Python interpreter is not always terminating.
user1804599
@TonyTheLion std::terminate is not considered terminating, actually.
while True: pass being the trivial proof
@StackedCrooked it's a lease.
user1804599
"Terminating" means "returns". std::terminate doesn't return.
16:58
@Jefery you can prove this using diagonalization
@Elyse wow really
@orlp The only diagonalization I know is the matrices one.
a language in which all constructs terminate in finite time must have X possible states
In set theory, Cantor's diagonal argument, also called the diagonalisation argument, the diagonal slash argument or the diagonal method, was published in 1891 by Georg Cantor as a mathematical proof that there are infinite sets which cannot be put into one-to-one correspondence with the infinite set of natural numbers. Such sets are now known as uncountable sets, and the size of infinite sets is now treated by the theory of cardinal numbers which Cantor began. The diagonal argument was not Cantor's first proof of the uncountability of the real numbers; it was actually published much later than...
Fuck you Wikipedia
user1804599
I like functions that return twice, such as fork and setjmp. :D
16:59
assuming all its components are discrete

« first day (1861 days earlier)      last day (3311 days later) »