« first day (1711 days earlier)      last day (3463 days later) » 

14:00
@BartekBanachewicz Yup. However, sanity is orthogonal
Side-effect map is dumb
let me put that in perspective
+        public void Start() {
+            lock (_lock) {
+                foreach (var daemon in _daemons) {
+                    Start(daemon);
+                }
+            }
+        }
+
+        public void Stop() {
+            lock (_lock) {
+                foreach (var daemon in _daemons) {
+                    Stop(daemon);
+                }
+            }
+        }
side-effect for is dumb
because it's exactly the same as side-effect map
this is 15 lines of code for what should be 2
and introduces code repetition
@BartekBanachewicz Yeah but you still get a side effect.
14:01
Oh no lines of code
@Griwes Intent matters
Intent behind map is not side effects
start = atomically . mapM_ startD $ daemons
stop = atomically . mapM_ stopD $ daemons
user1804599
public void _onAllDaemons(Action<Daemon> action) { lock (_lock) foreach (var daemon in _daemons) action(daemon); }
public void Start() { _onAllDaemons(Start); }
public void Stop() { _onAllDaemons(Stop); }
user1804599
:P
Point-free style is shit
@BartekBanachewicz What is that atomically doing?
14:01
Fuck pointless
@EtiennedeMartel take a wild guess
It does something
atomically
duh
@BartekBanachewicz Because it does the same fucking thing as that lock, but with fewer characters.
It doesn't do the same thing
yup, rightfold code solves the problems
14:02
it's a HOF for one
For the rest, assuming a ForEach extension method, you could get _daemons.ForEach(Start).
which it should be
It's STM, i.e. a vastly more complicated thing that you now have to understand
But LINQ with side effects is considered "bad style".
@CatPlusPlus as compared to manual thread syncing, lmao
14:03
Yes
this you don't have to understand at all
just slap locks around the place
no understanding required
I never said that
stop being bad hth
user1804599
Locks are easy to understand.
std::is_convertible<std::tuple<int&&>, std::tuple<int const&>>::value fails in clang C++14 but works in C++11.
14:03
@EtiennedeMartel Just map(deamons, Start);. That whole "map implies purity" thing is silly.
STM is vastly easier to understand than low-level thread operations
I need a workaround.
In fact, you do have to understand the entire thing in either case
@BartekBanachewicz googling
Higher-Order Fn
14:04
thx
@Griwes This is C#, we prefer methods.
Critical sections are trivial to understand
so is atomically
STM involves CAS and retries
forEach and map are the same thing, stop insisting on calling them differently.
14:04
@CatPlusPlus which you don't really need to care about
@BartekBanachewicz It's meant to iterate. There's no unnecessary iteration there, by definition.
@EtiennedeMartel Then deamons.map(Start);. vOv
@Griwes You're terrible at naming things
Map to what
@R.MartinhoFernandes it means to call Start on all of them, iteration is an implementation detail.
@R.MartinhoFernandes What he dislikes is to see the loop. He wants it hidden under an abstraction layer.
user1804599
14:05
Font Awesome isn't awesome. If it were then it'd have an ionizing radiation hazard symbol icon.
@R.MartinhoFernandes What are you trying to do?
@CatPlusPlus s/c/C/
@R.MartinhoFernandes wow. That's.. Interesting. Same library impl?
@Griwes Working around a compiler bug, I suppose.
@sehe Yes.
14:06
Bartek being Bartek, nothing new here
lets move on
@Griwes As I said, C# has a "foreach" statement. Hell, List even already has a ForEach method.
@TonyTheLion Thank you for this amazing discussion contribution.
Trying to sell STM as a simpler solution to a critical section than critical section is disingenuous
@EtiennedeMartel I guess it also has Map?
Why don't you throw a few insults too for good measure
14:06
2 hours ago, by sehe
Bartek's complexity traumas trigger when he sees special names for things that could have been functions. Composition, reuse, genericity etc.
@BartekBanachewicz You're welcome
user1804599
@BartekBanachewicz Thank you for this amazing discussion contribution.
@TonyTheLion that
Or dumb maybe idk what's the right word here
@BartekBanachewicz Remove newlines, duh
14:07
@Griwes No.
@TonyTheLion this is one of those rare cases where Bartek is mostly right. vOv
@BartekBanachewicz Right, because it magically figures out which parts must be seen atomically.
Or maybe it just treats the whole address space as atomic.
14:07
Did you see the _lock bit there?
This whole 'grr loops' thing is extremely dumb
It's important.
Sean!
@R.MartinhoFernandes No, I mean the original thing you are trying to do. I'm curious what got you to the point of trying to invoke that trait.
@R.MartinhoFernandes if you structure your state properly then it's obvious what parts it touches
14:08
Sean!
Come over here. We need to hear loops are ---bad--- evil
I would lock on _daemons personally.
@CatPlusPlus nope
But that's just me.
@BartekBanachewicz Blah blah vague magics.
Blah blah low-level thread primitives
we can go all day like this
14:08
I'll give you one thing that this evidences: it's not easy to understand it, evidence being that you didn't.
5
@BartekBanachewicz if you believe in miracles, it's easy to walk over water
@EtiennedeMartel Maybe
@BartekBanachewicz There are no threads.
I like separate locks
I like peanuts
14:09
@EtiennedeMartel nah, _daemons is not an agent, it's a data structure, don't lock on them (blah blah blah Griwes talking about magic semantics of his vaporware language)
It's a construct that defines a scope of mutual exclusion.
@MarcoA. I like trains
@R.MartinhoFernandes and what's the goal of it
Mutual exclusion
@BartekBanachewicz That's exactly what it does.
14:09
for god's sake
lol
@Griwes You can lock on any object.
@CatPlusPlus Like "peanuts" iff "not trains"
There are no explicit threads used btw
14:10
> nah, _daemons is not an agent, it's a data structure, don't lock on them (blah blah blah Griwes talking about magic semantics of his vaporware language)
It's all ~~highlevel~~
But that doesn't mean the threads are not there
totally highlevel considering you lock manually like a fucking animal
@BartekBanachewicz Mutual exclusion from all other scopes of the same mutual exclusion group. _lock is the ID of that group.
See what I mean about understanding the magic?
@BartekBanachewicz Great argument.
14:10
@BartekBanachewicz Err. Localized locks >> global locks.
The level is irrelevant.
@Griwes I know. I don't discuss languages that do not exist, like Wide, Elixir or anything that rightfold has ever done.
@BartekBanachewicz No, it's RAIId
ITT people argue like a fucking animal
roooooooarrrrrrrrrrr
@milleniumbug why don't you add 8 levels of nested using too
user1804599
14:11
lol my colleague just called a fax
@BartekBanachewicz Waaaahh waaaaaah I am blinded by my own ideology waaaah waaaah
See above about clinging etc
That's how you sound.
@TonyTheLion thank you
@EtiennedeMartel Horses.
14:11
@EtiennedeMartel OTOH your ideology clearly is prefect
Also your code doesn't change a thing
Changing this loop to a method that loops anyway is not an improvement
that's why I'm the blind one and you're not
@EtiennedeMartel ITT Elixir doesn't exist
user1804599
Luckily 8 nested usings only need one level of indentation!
14:12
Changing this lock to STM is not an improvement
@BartekBanachewicz And no, it is not, because it's not just the parts it touches.
Again, you clearly don't know what you're talking about.
@R.MartinhoFernandes which is the greatest argument of all time
@BartekBanachewicz I don't really have one. I just do whatever works. I agree with what Cat has done because it's probably the best possible option in C# considering his use case.
user1804599
Spawn a thread that reads requests from a queue.
user1804599
Actors!
14:12
I do not shoehorn a solution in a problem.
STM is not something you can use without consideration any more than locks
What you are doing is shoving the same peg in every hole.
ah right we're getting at "idiomatic" and "best solution one could make in this language"
@BartekBanachewicz I keep having to explain all the things you missed in your race to reduce it to "animalistic something". I think it's a fairly well substantiated assertion.
It's not about language
14:13
1 min ago, by Etienne de Martel
@BartekBanachewicz I don't really have one. I just do whatever works. I agree with what Cat has done because it's probably the best possible option in C# considering his use case.
fuck I'm getting tired by this
STM would be a bad solution in Haskell too
@BartekBanachewicz This always happens.
2 mins ago, by milleniumbug
Also your code doesn't change a thing
Because it's too complicated for the use case
14:14
@BartekBanachewicz i had no idea my use of mutex.lock() was base savagery ;__;
@Prismatic always there to help
@CatPlusPlus it's uh
user1804599
You'd need to put the daemon's state within the STM-managed state.
@rightfold clearly.
I don't understand STM enough to be comfortable using it frankly
@R.MartinhoFernandes yes, as soon as I'm getting insulted/called out for ignorance or blindness
14:14
@BartekBanachewicz Compilers cannot guess your invariants. It's that simple. (If they could, we'd be out of a job)
@BartekBanachewicz Which also always happens!
@R.MartinhoFernandes clearly this is an ideal state of affairs
You're being fanatic for no good reason IMHO
user1804599
And as a result the daemons can't do I/O.
@BartekBanachewicz far from it
@rightfold which is entirely reasonable.
14:15
@Prismatic std::lock_guard<decltype(mutex)> lock(mutex);
@BartekBanachewicz You brought this on yourself, you know. I dropped the blindness argument when you ran out of reasonable arguments.
Scoped locks FTW
@TonyTheLion it's great that you're working on changing it
user1804599
Daemons are likely to loop indefinitely (at least, until receiving a stop signal), which is only useful if you have side-effects, so no, it's not reasonable at all.
@nabijaczleweli Terrible, you have to give it a name.
14:16
@BartekBanachewicz Lots of other Loungers are trying, but they seem to run into a wall.
I have no reason to believe that my attempts at changing your view would make any difference
@Griwes Wide improves that!
Evidence suggests otherwise.
Wide is nice
user1804599
Purity sucks.
@BartekBanachewicz Did you notice that happened after you started arguing in terms of what is animalistic and what isn't?
14:17
@TonyTheLion so clearly throwing stuff like "bartek is bartek" is what you should do
We're a technical audience.
@R.MartinhoFernandes it happened before
You can give us technical arguments.
Ell
Ell
What are we talkin' about?
k
don't repeat code
14:17
@BartekBanachewicz oh you're still at that, sorry I offended you.
@rightfold lel
user1804599
@Ell locks vs STM
I personally think that such a scoped lock should be expressed as a higher-order function at least
16 mins ago, by rightfold
public void _onAllDaemons(Action<Daemon> action) { lock (_lock) foreach (var daemon in _daemons) action(daemon); }
public void Start() { _onAllDaemons(Start); }
public void Stop() { _onAllDaemons(Stop); }
like that, yes.
14:18
3-line function is not worth restructuring like that is the thing
Ell
Ell
Have you guys seen the talk on STM that michael wong did?
@BartekBanachewicz See? That's a reasonable assertion.
@Griwes The name is lock. Look at it
I'd still consider using STM, but I'd need to see the use case in depth
14:18
@Ell no, link?
@nabijaczleweli Exactly. The problem is... the name is there!
I personally think that STM is really intuitive to use, but it requires certain preconditions in program's state structure
@Griwes That's the opposite of a problem
As mentioned, this means that e.g. actors can't do IO; this could violate the transactions.
Woah. Nice headline
> NC jihad plotter: “I started thinking about death and stuff so I became a Muslim” link
14:19
You don't need to give a name for locks in Wide
Again. See how everything is better if you are careful about how you bring up points instead of just bashing people with the Rod of Absolutes?
Which is nice
I'm not sure what the articule says
Ell
Ell
^it even has locks vs STM in it
14:19
@nabijaczleweli It is not, once you have 6 or 10 scope guards in the same scope.
user1804599
btw @CatPlusPlus I wrote an IoC container in Python 3 wanna try
Ell
Ell
I remember @AndyProwl saying he can't listen to this guy for some reason
@sehe articule = article + ridicule?
@Ell thanks
I don't feel the need for STM
14:20
@Griwes How is naming "6 or 10" scoped lock guards after which mutex they lock a problem?
I can understand that. I think if you got more familiar with it you might change your mind, though.
@nabijaczleweli ...it is.
Clearly you haven't been there.
That being said, the whole wrapper class looks like something that could be abstracted away
@Griwes Not yet. Maybe one day...
lol if you have 10 locks at the same time
14:21
@milleniumbug articlation matters :)
into a class LockedWrapper<T> { collection<T> ts; add(T); remove(T); fmap(fn); }
@CatPlusPlus Also... is that ECS? I mean, you call your systems "daemons" and your entities "game objects", but still.
> 5 years experience minimum
> Competitive salary of 2 Slutty / hour
I personally think those locks obfuscate the actual purpose of the class
@buttifulbuttefly compelling to many
14:22
And should be abstracted away as an implementation detail
@EtiennedeMartel Processors are systems (which is a dumb fucking name), daemons are something else
And sorta maybe
I'm trying things out
look how little of actual functionality resides in that class
I had an idea how to compile available components into a ~~~data oriented~~~ container
@BartekBanachewicz locks are a design "detail", really. How you implement them is up to you, but you better make it explicit in some obvious way
Everything that has inputs and outputs is a system.
14:23
Your component related methods in GameObject should use TryGetValue rather than ContainsKey + indexer.
ITT gamedev
I don't like out so pff
Anyway it's not much of an improvement
@sehe well, on another side, why should it be explicit? Shouldn't you have a way to say "parallelize this shit, I don't care how"?
14:24
@Stacked do you keep older clang versions?
@BartekBanachewicz Locks are invariants.
"I changed one line of code (...) and execution times were now about 3.7x faster on our 4-core server." #Haskell
I don't need an interlocked collection
@BartekBanachewicz "I removed a Sleep(1000)"
@CatPlusPlus is this why you (re)implemented one?
-           do_things();
+           return;
14:25
Note how it explicitly holds the lock for entire Start and not just for each item
It's not equivalent to an interlocked collection
It does bit more
Well, and less
Really splitting it further is also not an improvement
Reuse on reuse, otherwise YAGNI
user1804599
Go generate accepts one specific flag:

	-run=""
		TODO: This flag is unimplemented.
user1804599
lol
well, we'll see how the project progresses
I might well be wrong
14:28
The most painful thing is plugin that recognises IoC for ReSharper
It can't deal with convention-based registration very well
It's sad
Internet of Cinchs
@BartekBanachewicz Even with an interlocked collection you can't reliably iterate over all of it without locking it.
@BartekBanachewicz The code you posted, however, is all about the invariants of the IO operations.
No daemon can be stopping while the daemons are being started; no daemon can be started while the daemons are being stopped.
oh well, I guess a certain structure requires certain solutions
You don't say
14:29
@BartekBanachewicz How is this message not a textbook example of picking a solution before the problem?
@R.MartinhoFernandes I saw a tiny part of the problem that suggested a solution
I have a product you might like
It's a mat with all those conclusions
@CatPlusPlus did someone say data oriented
14:31
@CatPlusPlus lol
@CatPlusPlus the only conclusion to be reached here is that I can't wait to play your thing
2
regardless of whatever way you do the locks
> can't wait to play your thing
DIDNT GET THE REFERENCE BURN THE WITCH
@CatPlusPlus of course I got it
14:32
@BartekBanachewicz Aww
I have barely any strength left to work on work project so dunno if it'll get anywhere
It has a websucket tho
@TonyTheLion The Polish sausage.
That has to count for something
user1804599
Yes, @ for unpacking is perfect.
Also it's worth to use C# just for R#
So
Use C#
user1804599
14:34
speaking of refactoring and analysis tools
still not convinced.
user1804599
I should learn how to use go oracle.
@FlorianMargaine But you do care how. Locks are just a materialisation of invariants.
C# is too complicated for my simple mind
No it isn't
14:34
It is.
user1804599
@BartekBanachewicz Use Go. It's simple.
I find all those IOC containers, OOP indirections, manual locks very confusing and complex.
That's why I use a simpler language that utilises mostly pure functions.
@rightfold still too complex.
Ell
Ell
use brainfuck
too inexpressive.
Lazy evaluation is not really simpler
14:37
I find all these RWS, arrows and category theory very confusing and complex
I like to build abstractions in a most easy and straighforward way
and I find function composition the easiest way to do so.
@BartekBanachewicz C# is too simple for my complex mind.
Most easy, highly straightforward
highly unneeded
@milleniumbug RWS is just a sum of R, W and S. It's not particularly hard once you understand the parts of it.
14:38
@BartekBanachewicz You don't have to use them, that's the thing.
as for arrows, well, I don't use them yet.
@EtiennedeMartel but then I'm left with a simple core that's more annoying to use than Haskell's simple core.
@Prismatic hahahhahahahha
user1804599
14:39
Awesome.
Haskell's solutions compose more easily imho and produce code that's very easy to understand
the abstractions are also more flexible
user1804599
This works so well.
@Prismatic fuck that's FAST
inb4 that's what she said
I still have problems with laziness, what's shared when, how the fuck fix works, and reading point-free
Haskell semantics are not easy
I don't use pointless
14:42
I screwed up I think at a question at the interview :<
The language might be smaller but it makes up in semantic complexity
most pointless
I was asked about a serious bug that took me a long time to fix
and I was unable to find anything
I never fixed anything big in my life :\
@CatPlusPlus I can deal fine with all that and I can also deal fine with what Bartek can't handle in C#. I prefer C# to build things.
Tooling <3
@CatPlusPlus I don't think laziness is too annoying in practice, at least I personally don't find it to be.
14:43
@CatPlusPlus What do you mean "shared"? I would have no idea how to share a value in Haskell.
My code doesn't use fix either.
It's not annoying per se, but it's harder to understand than eager evaluation
and for sharing, I pretty much always use STM.
That's not what sharing means
@CatPlusPlus I mean I almost never find myself thinking "how does lazy evaluation impact this piece of code"
except lazy sequences
Not hacked here, a sysadmin was logged in with the wrong account - sorry!
Well I like to know what my code does
@Feeds Well done.
@Feeds gg
@CatPlusPlus I do like that too, I just find that particular thing to not be that important
and I work with global opengl state, mind you
@FlorianMargaine if you can.
@CatPlusPlus don't find it a problem either
perhaps we just used it for different things
but I like juggled vertex arrays directly and didn't find any tragic performance hits
I had a memleak into OpenGL state once (constant buffer reuploading), but that was rather easy to trace and fix
It might not be a problem but I don't understand it
I don't think I really understand it either
14:46
lol
y'all are stupid
I don't understand many aspects of the language vOv
doesn't mean I can't use it to do my things
It can be a problem sometimes. Thunking too.
Oh I am aware it can be
just... so far I didn't have to think about it
so I kinda had no incentive to learn about that in depth
I can't say I know what's happening when I can't explain half of the language-provided behaviour
14:47
Hmm I thought a let expression was eager evaluated, and a where expression was lazily evaluated.
@CatPlusPlus My library draws things I want on the screen and does it fast. I am pretty sure I know enough about what's happening.
So isn't it just that if you do let x = [0...1000] in ..., then the list is fully evaluated?
let is not strict
@Jefffrey nah
case argument is
14:48
infinite lists
Top-level bindings, let bindings and where bindings are the same afair
are you failure-oriented or data-oriented?
Then maybe the list is definitely stored in x and used as x as opposed to have where x = ... which could be replaced with the value.
@Jefffrey what cat said above
no difference except syntax
@BartekBanachewicz It's very easy to make mistakes because the problematic code always seems extremely innocent.
14:50
@R.MartinhoFernandes I wish I could find such a problem in my code
I mean, really
@BartekBanachewicz It's hard to find because the problematic code always seems extremely innocent. :P
@R.MartinhoFernandes but for the code to be problematic, the problem needs to arise first, no?
The effects might not be noticeable until a certain scale.
I don't really have problems with my code :/
@R.MartinhoFernandes that's why I want to create a bigger usecase sample now
14:51
@R.MartinhoFernandes (sounds like UB)
I need a few stress-tests too
@nabijaczleweli No
on my issue list since forever
but I can only do so much myself
@nabijaczleweli No, the effects are usually in the form of unexpected performance hits.
Synthetic tests can't reliably detect problems like this
14:52
1 min ago, by Bartek Banachewicz
@R.MartinhoFernandes that's why I want to create a bigger usecase sample now
That's why actually understanding the behaviour of the code, including relevant semantics of the language, is important
"if it's not broken, don't fix it"?
@R.MartinhoFernandes My point was, that it sounds like it behaves similar to UB. w/e
I guess UB in cplusplus is similar
14:53
I really want to agree, but I just don't have enought experience on my hands I think
I guess I need to write more real-world haskell :P
@LucDanton ...
@nabijaczleweli Ah, I see. Yeah, in a way.
think about it, it makes sense
So, no help with my clang issues?
14:55
I don't think anyone feels competent enough to help you
Fuck you guys. This is what I pay you for.
It's crazy how shots were not fired in this thread
It's almost as if you were learning to discuss with other people
shut up jefflon
14:59
you suck jefflon
Ugh my productivity is zero now, too tired
btw how's your game engine envoyage going @Jefff

« first day (1711 days earlier)      last day (3463 days later) »