|
Or, you can create a thread for each core, pin them and give it a high priority and happily do coop multithreading yourself. Plenty of game devs necessarily do this, same for OpenMP, Intel TBB, etc.
|
# ? Jan 8, 2020 10:43 |
|
|
# ? May 17, 2024 01:16 |
|
Space Gopher posted:Yes, it's very dumb. That's more or less what I was thinking, I just wanted to make sure it wasn't my "Jonathan Blow is an idiot" bias talking.
|
# ? Jan 8, 2020 16:12 |
|
In our lovely webapp hellscape future, maybe it will fully come back! You just need a core for each browser tab to be pinned to and boom
|
# ? Jan 8, 2020 17:24 |
|
Under cooperative multitasking, the basic programming model assumes exclusive access to all accessible resources, so the vast majority of code has to be assumed to be unsafe to run with true concurrency, which means it’s very difficult to take advantage of having multiple cores outside of well-defined problems with lots of obvious parallelism (e.g. a library function to rotate an image). That kind of parallelism comes up a lot in the sorts of domains that use supercomputers, but consumer machines inevitably do a lot of heterogenous computation, and cooperative multitasking basically made it impossible to keep more than one core active for long. So it’s really the exact opposite of what Blow is suggesting: the growth of multi-core machines in the basic consumer market is exactly what killed cooperative multitasking. Also I‘s not sure what he’s trying to say about core migration in preemptive multitasking but it sounds wrong. Probably he has some half-assed understanding of the problem and assumes it’s perfectly accurate like usual.
|
# ? Jan 8, 2020 17:54 |
|
I actually read "cooperative multitasking" as "non-preemptive scheduling", because only the latter makes sense these days. (ignoring restrictive embedded systems etc)
|
# ? Jan 8, 2020 17:56 |
|
Clever use of x86's atomic instructions can get you pretty far. I think the downside is that they're serializing but I might actually be wrong about that and just thinking about the lock prefix. I was looking at jai to see if he had implemented them but I can't even find anything about multithreading on there so that's probably what is causing his complaint. E: I don't know a bunch about video juegos, but isn't it acceptable to interpolate a bit to make up for any 'suprises'? What would it take for there to be an unacceptable delay? dougdrums fucked around with this message at 19:33 on Jan 8, 2020 |
# ? Jan 8, 2020 19:21 |
|
Linear Zoetrope posted:Oh, Python? That's easy, if numpy and scipy have taught me anything it's that the correct way to handle this is having a function that takes in a half-documented string badly acting as an enum to select the algorithm.
|
# ? Jan 8, 2020 19:25 |
|
dougdrums posted:I was looking at jai to see if he had implemented them but I can't even find anything about multithreading on there so that's probably what is causing his complaint. Hmm, people are saying my language needs thread primitives, but what if nobody needed threads because... multicore?!
|
# ? Jan 8, 2020 19:41 |
|
dougdrums posted:I don't understand why they do this since the enum module exists, so you'd have the benefit of knowing what options exist without looking at docs and it can be docstringed. I imagine it has something to do with decrepit Python 2 support like most other hosed up things in Python but idk for sure It's partly because those numpy functions were around much longer than the enum module and the advantages of using an enum aren't compelling enough to break backwards compatibility outside of a new major release. But the reason it was done that way originally is because numpy was designed to look like Matlab and Matlab uses strings as enums a lot QuarkJets fucked around with this message at 21:13 on Jan 8, 2020 |
# ? Jan 8, 2020 21:10 |
|
Critically successful indie game developer Jonathan Blow, of The Witness fame: quits game development to create an ergonomic, high-performance, GC-free, JIT-free programming language specifically designed for game development, obliquely named after himself. After five years of non-stop Twitch coding and countless tweet-storms, Jon sadly has yet to release so much as a compiler pre-alpha. Commercially successful indie game developer Brian Fiete, of Bejeweled fame: quits game development to create an ergonomic, high-performance, GC-free, JIT-free programming language specifically designed for game development, obliquely named after himself. After five years of quiet coding in absolute obscurity and having tweeted a grand total of seventeen times in ten years, Brian has made available six hours ago the very first public release of the language compiler, the core libraries, extensive documentation, cross-platform targeting (Windows, Mac, Linux, iOS, Android), command-line build tools, and a full cross-platform IDE (Windows, Mac, Linux) featuring autocompletion, refactoring tools, debugging, profiling, incremental compilation, hot code swapping including data layout, memory leak detection, and per-type or per-method optimization levels. Critics have described the current status of Jonathan Blow as e: from the man himself on HN: Brian Fiete posted:There's a lot of overlap ideologically [with JAI]. One major difference is that I'm an IDE fan and Jonathan dislikes IDEs. That can really percolate through a language. e2: unrelated horror: current count of vegan HN posters who are seriously offended that a man with the initials B.F. has decided to name a programming language after literal cow murder: 5. NihilCredo fucked around with this message at 21:55 on Jan 8, 2020 |
# ? Jan 8, 2020 21:44 |
|
Nobody knew programming languages could be so complicated.
|
# ? Jan 8, 2020 21:54 |
|
NihilCredo posted:Beef I'm guessing this does fit in here.
|
# ? Jan 9, 2020 05:12 |
|
Adding new fields to existing types is solidly in the category of cool but bad ideas.
|
# ? Jan 9, 2020 05:45 |
|
Obligatory Beef post about Beef.
|
# ? Jan 9, 2020 08:11 |
|
Doesn't C# also allow you to do that? Or is that for methods only?
|
# ? Jan 9, 2020 08:34 |
|
Xarn posted:Doesn't C# also allow you to do that? Or is that for methods only? methods only (at this stage). methods are e z since extension methods are just some light syntactic sugar over static methods in static classes there's been interest from the language team about "extension everything" - properties/fields/operators/events/the whole nine yards, but nothing has eventuated yet because (1) it's hard (2) there are more useful things to work on and (3) it's hard
|
# ? Jan 9, 2020 09:07 |
|
Here's another fun bit from Beef.code:
Though I suppose C++ technically lets you do the same thing with evil pointer arithmetic shenanigans.
|
# ? Jan 9, 2020 10:39 |
|
What's the point of even having different levels of accessibility when it's not guaranteed. Looking forward to links in this thread years from now where library users just litter their code base with [friend]. Then complain when the internal implementation changes.
|
# ? Jan 9, 2020 11:41 |
|
Xik posted:What's the point of even having different levels of accessibility when it's not guaranteed. Only good use I can think of offhand is tests
|
# ? Jan 9, 2020 12:10 |
|
Xik posted:What's the point of even having different levels of accessibility when it's not guaranteed. Users already do that with reflection so at least this makes the kludge more obvious. Inevitably you run into a badly designed API you gotta work around. I get the feel Beef isn't trying to be an "ideal language" but just soften all the nasty hacks and footguns C/C++ is used to. All stuff that was already possible but ugly. And coming with an IDE out of the box is super refreshing. SupSuper fucked around with this message at 12:19 on Jan 9, 2020 |
# ? Jan 9, 2020 12:16 |
|
Yeah I don't see that Friend keyword as a hack - access modifiers are a declaration of a contract, not a security system. Requiring the use of an explicit "I know what I'm doing at my own peril" token is the appropriate level of enforcement, no different from using unsafe {}. And unlike going through a reflection call, it lets the compiler keep type-checking your code.
|
# ? Jan 9, 2020 14:20 |
|
There are plenty of times accessibility specifiers get in my way especially when I'm just writing some hacky debugging code. I like that as a solution
|
# ? Jan 9, 2020 16:53 |
|
Yeah, it's nice to be able to subvert protection mechanisms in way that are not undefined behaviour (as I think the usual pointer tricks in C++ would be).
|
# ? Jan 9, 2020 19:24 |
|
Xik posted:What's the point of even having different levels of accessibility when it's not guaranteed. Access modifiers that live at the "strong suggestion, not guaranteed" level work just fine in Java and C#.
|
# ? Jan 9, 2020 19:35 |
|
Looks like I'm out numbered in that opinion so I concede. Reflection is extremely powerful in C#, but it's basically number one on the hitlist for abused features in my experience.
|
# ? Jan 9, 2020 20:07 |
|
https://www.newscientist.com/article/2229238-a-lazy-fix-20-years-ago-means-the-y2k-bug-is-taking-down-computers-now/
|
# ? Jan 9, 2020 21:39 |
|
https://twitter.com/MStrehovsky/status/1215331352352034818 It's pretty interesting but absolutely qualifies as a coding horror.
|
# ? Jan 10, 2020 02:09 |
|
That's some mighty powerful backwards compatibility.
|
# ? Jan 10, 2020 02:25 |
|
https://twitter.com/markberman/status/1215463797126836224
|
# ? Jan 10, 2020 03:47 |
|
Mode 7 posted:Apparently, a guy on Reddit has patched a bug in the SFV netcode in 2 days that Capcom hasn't fixed in 4 years?
|
# ? Jan 10, 2020 12:39 |
|
The developer of classic indie game VVVVVV just released its source code to celebrate its 10 year anniversary https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_version/src/Game.cpp tag yourself i'm the 4000 line switch statement that appears to contain most of the gameplay logic actually no i'm the build instructions urging you to only using debug builds because optimizations break the game
|
# ? Jan 10, 2020 17:41 |
|
I'm the 70 lines of if statements for hard coded controls game programming always produces the best horrors
|
# ? Jan 10, 2020 17:56 |
|
I've never coded a game and don't have any interest in coding games, but when I see game code posted in Horrors I usually assume it's for the same reason there's a lot of lovely HTML/CSS/JS. Namely, some non-programmer had a dream and pushed and shoved at their keyboard to make their dream a reality. Really, I kind of respect it.
|
# ? Jan 10, 2020 18:19 |
|
Thermopyle posted:I've never coded a game and don't have any interest in coding games, but when I see game code posted in Horrors I usually assume it's for the same reason there's a lot of lovely HTML/CSS/JS. Namely, some non-programmer had a dream and pushed and shoved at their keyboard to make their dream a reality. Sometimes a novice programmer with enough creativity and dedication nails it with a great game, regardless of how garbage the code is. Definitely respectable. I suspect a lot of the the one-hit wonders lose momentum because they don't learn anything from the technical debt of their first success.
|
# ? Jan 10, 2020 18:57 |
|
Terry admits that his code was awful, because he wasn't a professional programmer, just an amateur gamedev. But some of it comes from the fact that Flash has you structure your project in a very different way, and that reads like a horror when directly translated to C++. Like the level data, the string-based level data was very common in Flash at the time, since that's what tooling was easiest to generate for. Lots of the code I have no strong qualms with. It's just what gameplay code looks like. Dicey Dungeons is supposedly a lot better made.
|
# ? Jan 10, 2020 19:00 |
|
This clearly validates jblow's assertion that game programmers truly are the best programmers.
|
# ? Jan 10, 2020 19:15 |
|
repiv posted:The developer of classic indie game VVVVVV just released its source code to celebrate its 10 year anniversary
|
# ? Jan 10, 2020 23:02 |
|
repiv posted:The developer of classic indie game VVVVVV just released its source code to celebrate its 10 year anniversary I'm the sense of utter frustration when playing the actual game too
|
# ? Jan 10, 2020 23:28 |
|
As a former game developer let me tell you they're basically all like that
|
# ? Jan 11, 2020 00:27 |
|
|
# ? May 17, 2024 01:16 |
|
xtal posted:As a former game developer let me tell you they're basically all like that Have you thought about better method naming? You know, to not expose implementation details?
|
# ? Jan 11, 2020 00:47 |