|
Subjunctive posted:Threads are terrible, if that helps. This one is a perfect example.
|
# ? May 6, 2016 01:30 |
|
|
# ? Jun 1, 2024 19:11 |
|
fritz posted:This one is a perfect example.
|
# ? May 6, 2016 03:00 |
|
I spent an hour today tracking down memory leaks in Python code.Python code:
I don't like Python very much.
|
# ? May 6, 2016 03:41 |
|
If you need parallelism in your glue scripting language, you are doing something wrong.
|
# ? May 6, 2016 07:15 |
|
Problem is enough people use python as a primary development language, not just as a scripting language.
Pavlov fucked around with this message at 07:41 on May 6, 2016 |
# ? May 6, 2016 07:39 |
|
TooMuchAbstraction posted:The lack of block scoping and the lack of true multithreading are my biggest peeves with Python, and I'm honestly not certain which of the two is worse. Definitely the weird scoping.
|
# ? May 6, 2016 08:08 |
|
Munkeymon posted:Cuntpunch said he started out of nowhere, which points to it not being that insipid habit. Perhaps he read the reader letter in a recent CACM which advertised this as a good idea. it isn't when the compiler doesn't enforce it and the next merge scrambles your oh so carefully maintained comments
|
# ? May 6, 2016 08:14 |
|
Threads are terrible, and the only thing worse is not having them and having to fake them. Back when I was doing DOS programming, there were lots of C libraries where cooperative multithreading was faked with setjmp/longjmp. Every one of them had their own unique... well, "quirks" was the most charitable word for it.
|
# ? May 6, 2016 08:30 |
Athas posted:If you need parallelism in your glue scripting language, you are doing something wrong. Tons of scientific libraries (in my case Astropy) more-or-less only exist in Python, or the alternatives are worse. Plus, sometimes you gotta use what your collaborators use.
|
|
# ? May 6, 2016 08:49 |
|
Zemyla posted:Threads are terrible, and the only thing worse is not having them and having to fake them. Back when I was doing DOS programming, there were lots of C libraries where cooperative multithreading was faked with setjmp/longjmp. Every one of them had their own unique... well, "quirks" was the most charitable word for it. I had to write one of those libraries in college. As best I can recall we would have aspired to only have "quirks."
|
# ? May 6, 2016 13:48 |
|
Athas posted:If you need parallelism in your glue scripting language, you are doing something wrong. That isn't even remotely true. There are plenty of simple scripting tasks where you want to run multiple things at once. I've even turned shell scripts into makefiles because it was the lowest-effort way of parallelizing parts of them.
|
# ? May 6, 2016 14:06 |
|
Javascript has taken an interesting approach to threading by first not having any at all (a good move), and then having them only in the VM to handle queued async callbacks, and then "webworkers" which is just message-passing only threading, and now they're introducing more threading primitives but trying to make it so you cannot possibly gently caress this up and have to deal with real threading problems.
|
# ? May 6, 2016 14:14 |
|
VikingofRock posted:Tons of scientific libraries (in my case Astropy) more-or-less only exist in Python, or the alternatives are worse. Plus, sometimes you gotta use what your collaborators use. Plorkyeran posted:That isn't even remotely true. There are plenty of simple scripting tasks where you want to run multiple things at once. I've even turned shell scripts into makefiles because it was the lowest-effort way of parallelizing parts of them. I admit I was being a bit facetious, partly because Python is so very slow that I cannot see why one would want to parallelise it (writing performance-intensive parts in another language seems like a better approach). That aside, isn't the GIL only an issue for running Python bytecode in parallel? As I have been led to understand, functions called through the FFI (that have not asked for the global lock), as well as subprocesses, can run in parallel just fine.
|
# ? May 6, 2016 14:25 |
|
Zemyla posted:Threads are terrible, and the only thing worse is not having them and having to fake them. Back when I was doing DOS programming, there were lots of C libraries where cooperative multithreading was faked with setjmp/longjmp. Every one of them had their own unique... well, "quirks" was the most charitable word for it. User threads are actually really good when done correctly (i.e. goroutines). There's definitely no way to make the internals pretty, though
|
# ? May 6, 2016 14:32 |
|
Considering processors have tapered off on improving speed, parallelism is kind of mandatory if you want to process some poo poo quicker. Too bad it's such a goddamn pain in the rear end.
|
# ? May 6, 2016 14:54 |
|
piratepilates posted:Javascript has taken an interesting approach to threading by first not having any at all (a good move), and then having them only in the VM to handle queued async callbacks, and then "webworkers" which is just message-passing only threading, and now they're introducing more threading primitives but trying to make it so you cannot possibly gently caress this up and have to deal with real threading problems. this is a reasonable approach in the case of a language with, uh, let's say "such a low barrier to entry".
|
# ? May 6, 2016 19:27 |
|
I maybe don't understand them, but I don't like the approaches to concurrency in C#. I think there's like three different ways you can make the same thread pool with the same scheduler, and the built in scheduler can be a bit wonky sometimes. I think what happens is that most implementations try to hand-wave or generalize a lot of stuff, but not all programs need to use concurrency in the same manner. I've been working on an actor model library on and off for awhile, and I get so frustrated with the schedulers. On Windows, multithreading with .net works pretty well if I use my own userspace scheduler. Linux is a scheduling disaster. If I let it run long enough, Mono segfaults in a way that I can't take the time to understand, and CFS will stall my long-running threads unevenly and at weird times, even if I peg them to a core. I've tried mucking with it but I usually end up making it worse , when all I want is my few background threads to get equal shares. (Of course it technically doesn't matter if they get equal shares, as far as the logic goes, it would be nice though. It keeps one thread's message queue from overflowing into the others...) While what I'm trying to do directly involve scheduling, I think the point I'm trying to make is that schedulers should start with a simple set of models and allow you to tune and combine them as you please, or perhaps offer several different models. I think that's the point of C#'s threading syntax, but it all becomes a good ol' threadpool iirc. It would be nice if they tried to make scheduling a little less 'magical'. I haven't looked at Go, but I'm scared of new things ... after doing a little reading, does the 'go' keyword actually create a new thread or process every time? As far as python goes, I learned python by making an IRC server, along with realizing that python isn't terribly good for it. Python == the REPL as far as I'm concerned, which it conceptually excels at. And there's this, "The Linux Scheduler: a Decade of Wasted Cores": http://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf dougdrums fucked around with this message at 19:36 on May 6, 2016 |
# ? May 6, 2016 19:31 |
|
Go is m:n threaded. The go keyword creates a new "goroutine": a lightweight somewhat green thread-like, somewhat coroutine-like thing, which exists only in the OS process. It's similar to Erlang processes, though more primitive. The Go runtime multiplexes and schedules goroutines onto multiple OS threads. It's not a panacea to the terrors of concurrency and parallelism by any means. But it's nicer to deal with in practice than many approaches, though not as nice as others. Like many things in Go it sits at this weird middle ground between high- and low-level. Not for everyone, but I like it.
|
# ? May 6, 2016 19:53 |
|
dougdrums posted:And there's this, "The Linux Scheduler: a Decade of Wasted Cores": Love this paper.
|
# ? May 6, 2016 19:54 |
|
Subjunctive posted:Love this paper. I like that they only cite Torvalds to make him look like an rear end. Also, when I was in the navy I used to read case studies on ship collisions and other nautical accidents to pass the time. It reminds me so much of a literal shipwreck, too many cooks over a long period of time and all. dougdrums fucked around with this message at 20:14 on May 6, 2016 |
# ? May 6, 2016 20:00 |
|
Lonely Wolf posted:Go is m:n threaded. I thought I read something that said until recently the default number of threads used by the go runtime was "1", does anybody know what I'm thinking of?
|
# ? May 6, 2016 21:55 |
|
Grinding through some Java code written by a cow orker and find this at the end of every function. If ("" != null) return X; Throw new Exception("Missing return statement in function"); I have no idea why.
|
# ? May 6, 2016 22:03 |
|
hyphz posted:Grinding through some Java code written by a cow orker and find this at the end of every function. Without the condition there would be an error for dead code, so that explains one part. I can't get all the way to understanding the rest.
|
# ? May 6, 2016 22:05 |
|
fritz posted:I thought I read something that said until recently the default number of threads used by the go runtime was "1", does anybody know what I'm thinking of? You're thinking of GOMAXPROCS, which controls the number of simultaneously executing goroutines and used to default to 1. The runtime still used multiple kernel threads because a goroutine inside a syscall or C code doesn't count as executing
|
# ? May 6, 2016 22:31 |
|
fritz posted:I thought I read something that said until recently the default number of threads used by the go runtime was "1", does anybody know what I'm thinking of? They changed the default from 1 to runtime.NumCPU() a year or two back, after a lot of work to improve the scheduler. It's always been a tunable, though. Before the change, a lot of programs just started off with runtime.GOMAXPROCS(runtime.NumCPU()).
|
# ? May 6, 2016 22:32 |
|
Soricidus posted:this is a reasonable approach in the case of a language with, uh, let's say "such a low barrier to entry". It also makes a lot of sense for a language that was made in 1995 very quickly and hasn't required a good deal of multithreading until now. Still not sure why they went with "webworkers" for the name though.
|
# ? May 6, 2016 22:49 |
|
hyphz posted:Grinding through some Java code written by a cow orker and find this at the end of every function. The compiler already checks for missing return statements, so we're converting compile time errors into runtime errors? As a bonus, we can infer that every function throws Exception
|
# ? May 7, 2016 00:45 |
|
piratepilates posted:Still not sure why they went with "webworkers" for the name though. Can you use them outside of a browser? BrowserWorker doesn't quite have the same ring to it.
|
# ? May 7, 2016 01:38 |
|
There's webworker libraries for node.js, but actually using them sounds like a terrible idea.
|
# ? May 7, 2016 02:54 |
|
Doesn't look like nodejs has native webworker support (for whatever loving reason) but there are add-ons or what not to add them, also there's stuff like node-fibres and other add-ons for other threaded support.
|
# ? May 7, 2016 05:50 |
|
piratepilates posted:Doesn't look like nodejs has native webworker support (for whatever loving reason) but there are add-ons or what not to add them, also there's stuff like node-fibres and other add-ons for other threaded support. Yeah, WebWorkers were designed for the browser. Someone implemented the API using threads for... reasons?
|
# ? May 7, 2016 05:59 |
|
code:
The little script to make this work
|
# ? May 7, 2016 07:51 |
|
Carbon dioxide posted:[code]Alexs-Macbook:~ alex$ woodoo Least this could've done was spell the Pokemon name correctly. Unless a joke just went way over my head.
|
# ? May 7, 2016 11:22 |
|
andipossess posted:Least this could've done was spell the Pokemon name correctly. Unless a joke just went way over my head. It's a good joke.
|
# ? May 7, 2016 14:21 |
|
Suspicious Dish posted:I spent an hour today tracking down memory leaks in Python code. im pretty sure that if it were possible to ban recursion completely in python, guido would have done it
|
# ? May 7, 2016 14:38 |
|
andipossess posted:Least this could've done was spell the Pokemon name correctly. Unless a joke just went way over my head. Remove space and read again.
|
# ? May 7, 2016 14:59 |
|
It's actually sudowoodo without the second o but I couldn't be bothered the remove it figuring nobody would care.
|
# ? May 7, 2016 15:41 |
|
Carbon dioxide posted:It's actually sudowoodo without the second o but I couldn't be bothered the remove it figuring nobody would care. You assumed that a bunch of goons wouldn't be pedants about minor spelling errors? Big mistake.
|
# ? May 7, 2016 19:56 |
|
code:
|
# ? May 10, 2016 11:06 |
|
|
# ? Jun 1, 2024 19:11 |
|
This isn't even the same person as the last horror. But, like the other one, also has 5+ years of experience and is considered to fill a mid-senior seat!code:
Programmers: Huge, fragile egos. Cuntpunch fucked around with this message at 17:24 on May 10, 2016 |
# ? May 10, 2016 13:49 |