|
The point is that if you need to retry an operation, inject a class that handles retrying it and call THAT instead. What happens if you need to retry it twice? Just add another ?? GetMessage() to everything? Awful.
|
# ? Sep 14, 2012 17:21 |
|
|
# ? May 29, 2024 08:14 |
|
Vanadium posted:Clay looks like it shares some DNA with Haskell, so I'm all for it Yeah, it really got a ton of poo poo right already, and a lot of the important stuff is the basis for language and not an after-thought. It's like the designer actually understood what makes a good language before he went out and designed a language, and knows C++ well enough to actually understand what is required to make a "better C++." Usually I have some nasty criticism about a language, but I don't really with Clay yet. I don't think I really like the fact that overload selection is partially based on ordering, though. IMO, if something is ambiguous, it probably should be a compile error and shouldn't just pick the last one. If anything, if you want the unambiguous behavior and you want your newly-written implementation to be used, I think you should have to be explicit about it (I.E. somehow reference the previous overload that would be a worse match in the declaration of the new overload to notate that this one takes precedence). Anyway I do a lot of generic programming and I just don't see the rationale for this feature at all, but perhaps I'm missing something? Edit: errrr actually, I guess I misunderstood and it's worse than that? It uses the first match it finds in reverse order, so something that'd be a worse pick in C++ would be picked over a better one if it were written later. I don't see why anyone would want this behavior. That Turkey Story fucked around with this message at 17:44 on Sep 14, 2012 |
# ? Sep 14, 2012 17:26 |
|
npe posted:The point is that if you need to retry an operation, inject a class that handles retrying it and call THAT instead. What happens if you need to retry it twice? Just add another ?? GetMessage() to everything? Awful. How about if GetMessage actually sets a flag when it's called the first time so the next time it gets called it knows to do special extra error handling stuff if it fails again. Simple!
|
# ? Sep 14, 2012 17:29 |
|
Optimus Prime Ribs posted:No version control of any kind. git init or hg init Do it now.
|
# ? Sep 14, 2012 17:39 |
|
That Turkey Story posted:Edit: errrr actually, I guess I misunderstood and it's worse than that? It uses the first match it finds in reverse order, so something that'd be a worse pick in C++ would be picked over a better one if it were written later. I don't see why anyone would want this behavior. The language isn't set in stone at this point so it might be profitable to talk about this on its mailing list
|
# ? Sep 14, 2012 18:40 |
|
npe posted:The point is that if you need to retry an operation, inject a class that handles retrying it and call THAT instead. What happens if you need to retry it twice? Just add another ?? GetMessage() to everything? Awful. Yeah, that's what we do, but it still bothers me that we have to do it at all to work around the bullshit CRM 'requirement'. Just more annoying boilerplate that has to be built to support a system that's mostly pointless.
|
# ? Sep 14, 2012 19:31 |
|
That Turkey Story posted:Yeah, it really got a ton of poo poo right already, and a lot of the important stuff is the basis for language and not an after-thought. It's like the designer actually understood what makes a good language before he went out and designed a language, and knows C++ well enough to actually understand what is required to make a "better C++." Usually I have some nasty criticism about a language, but I don't really with Clay yet. The design looks pretty good in general. I'm hoping that when they do Unicode support they get it right (opaque string objects and arrays of bytes are different things). Looking at the standard library though the code is a bit, weird. Hopefully that will get better as they understand the language they've created better.
|
# ? Sep 14, 2012 19:43 |
|
Optimus Prime Ribs posted:Well at least it wasn't all hand written then. What exactly is wrong with it?
|
# ? Sep 14, 2012 20:28 |
|
yaoi prophet posted:What exactly is wrong with it? It's dependent on JavaScript being enabled, and is overly complex. Doing this in CSS would be so much simpler: CSS code:
|
# ? Sep 14, 2012 20:35 |
|
Geisladisk posted:Who in their right mind would make something as integral as a unit in a RTS game inherit from three seemingly totally unrelated classes? This is the straight-jacket of inheritance. If you want behavior shared between classes, it's going to be beneficial to share the code as well instead of doing c&p. Languages that support composition as an alternative to inheritance (see: traits / mixins) can be a win here, as you can gain shared code without contaminating the class tree. Of course, most of these languages tend to be scripting languages, so you wouldn't be caught dead writing an RTS in one anyway.
|
# ? Sep 14, 2012 21:25 |
|
McGlockenshire posted:This is the straight-jacket of inheritance. If you want behavior shared between classes, it's going to be beneficial to share the code as well instead of doing c&p. Nothing in C++ required this approach. You don't need a scripting language to avoid misusing inheritance.
|
# ? Sep 14, 2012 21:29 |
|
McGlockenshire posted:This is the straight-jacket of inheritance. If you want behavior shared between classes, it's going to be beneficial to share the code as well instead of doing c&p. Now I want to write an RTS in Python.
|
# ? Sep 14, 2012 21:30 |
|
This past summer, I got some work in a trucking company's IT department maintaining their software, all of it RPG/4 code running on an IBM i System. As a second year college student, it was a great introduction to the joys of working on inherited code (nobody in the department was an original author of the core system). Some of the code I was working on hadn't been modified since the Clinton administration. That's not the horror, though. My main project was to move the code to a more object-oriented model, where the database was only being updated when the dispatcher hit the enter key to dispatch a load. In the old system, as soon as the dispatcher accessed a database file they had that driver or vehicle's record locked until they hit the enter key, leading to lots of record lock problems. This is still not the horror, though. There wasn't an alternative until recently, and I was hired to implement it. While moving the update code to a service program, I found that all of the dispatch programs were loading the wrong data into the Outbound Grid field of the vehicle database. They were loading in the Outbound Region data. The problem with this is that Outbound Region is an alpha field (RPG's name for strings), and Outbound Grid is a decimal field (numeric), which should cause aborts, since some Region codes have alphabetic characters in them and there was no conversion in place. But somehow, this was never causing aborts, or causing a problem somebody would notice. At first my supervisor and I concluded this was some bizarre programming decision, until we asked the department head, who's been with the company since nearly the beginning of the database. His conclusion was that it was a typo. The kicker? Part of our company's coding standard is to tag any revisions, so we know when code was added. The typo had no tag. This typo had been undetected and part of a program that ran every day, and somehow never caused an abort, in 20 years.
|
# ? Sep 14, 2012 21:40 |
|
Thermopyle posted:Now I want to write an RTS in Python. Civ 4 uses Python scripting, but it's an old game so it's 2.3 or so. Might be kind of unpleasant.
|
# ? Sep 14, 2012 22:53 |
|
Thermopyle posted:Now I want to write an RTS in Python. Supreme Commander might as well be written in Lua; there's a hard nugget of C++ for rendering, physics and netcode and the rest is a shitload of Lua scripts. Python isn't much of a stretch.
|
# ? Sep 14, 2012 23:00 |
|
Munkeymon posted:Civ 4 uses Python scripting, but it's an old game so it's 2.3 or so. Might be kind of unpleasant. One of the reasons it bogs down so much late in long running games
|
# ? Sep 15, 2012 00:09 |
|
Otto Skorzeny posted:One of the reasons it bogs down so much late in long running games Civ V isn't much better in that respect -- they ditched python for lua. Maybe I'm crazy, but I really don't see what the big advantage is with using either of them over something that's statically typed for this. I know the games pretty well and while there's a lot of stuff going on it's pretty straightforward. There has to be some simple, statically-typed language that works with LLVM that you could use as a scripting language instead.
|
# ? Sep 15, 2012 00:31 |
|
I realize it's a self-aware horror, but I think those still belong here: https://github.com/videlalvaro/gifsockets "This library demoes how to achieve realtime text communication using GIF images as transport."
|
# ? Sep 15, 2012 01:31 |
|
yaoi prophet posted:What exactly is wrong with it? It's a hold over from the early days when browsers didn't support the css :hover attribute.
|
# ? Sep 15, 2012 01:42 |
|
Gigantic Slut Man posted:I realize it's a self-aware horror, but I think those still belong here: https://github.com/videlalvaro/gifsockets
|
# ? Sep 15, 2012 03:20 |
|
Aleksei Vasiliev posted:I like that they tout that it works in IE6 but it's only in the code sample that it notes it doesn't work in Firefox. Surely a polyfill exists.
|
# ? Sep 15, 2012 03:29 |
|
That Turkey Story posted:Civ V isn't much better in that respect -- they ditched python for lua. Maybe I'm crazy, but I really don't see what the big advantage is with using either of them over something that's statically typed for this. I know the games pretty well and while there's a lot of stuff going on it's pretty straightforward. There has to be some simple, statically-typed language that works with LLVM that you could use as a scripting language instead. In the case of Lua, the advantage is that it's a very small, simple language designed from the start for being compact, fast, and easy to embed - it's a configuration and scripting language first and foremost. I don't know if it was around when CiV was written, but it also has two JIT interpreters - luaJIT and llvm-lua - which are API compatible with the reference implementation and pretty fast. There are statically typed languages they could use, and some of them might even be faster, but I can't think of any offhand that are designed to be easy to embed and use as a scripting/configuration language. (Also, there are enough high-performing games that use Lua heavily that, even without luaJIT, I don't think you can blame CiV's performance woes on the choice of language.) ToxicFrog fucked around with this message at 03:36 on Sep 15, 2012 |
# ? Sep 15, 2012 03:34 |
|
Gigantic Slut Man posted:I realize it's a self-aware horror, but I think those still belong here: https://github.com/videlalvaro/gifsockets So they reinvented Motion JPEG with animated GIFs? And they think this is in some way notable or interesting? edit: Oh, it's an open-source Clojure implementation of something from 13 years ago. So even more stupid. pseudorandom name fucked around with this message at 05:29 on Sep 15, 2012 |
# ? Sep 15, 2012 05:27 |
|
Yeah, you can't actually read data out of the "gif socket" from JS. You can just show some text on the GIF or something.
|
# ? Sep 15, 2012 05:41 |
|
Suspicious Dish posted:Yeah, you can't actually read data out of the "gif socket" from JS. You can just show some text on the GIF or something. Now I want to know what happens if you try drawing it onto a canvas and then pixel introspecting.
|
# ? Sep 15, 2012 05:58 |
|
ToxicFrog posted:In the case of Lua, the advantage is that it's a very small, simple language designed from the start for being compact, fast, and easy to embed - it's a configuration and scripting language first and foremost. I don't know if it was around when CiV was written, but it also has two JIT interpreters - luaJIT and llvm-lua - which are API compatible with the reference implementation and pretty fast. Speaking as someone who has worked on multiple professional games that have used lua for gameplay scripting, performance problems do get traced back to lua, through profiling, and it's really not specific to lua either. The problem for us was mainly due to creating lots of objects in lua, which all end up being dynamically allocated and garbage collected. If for every bullet or projectile you're spawning an object in lua, and all of your objects are dynamically typed and all of your function calls are on types in a dynamic language, it does cripple performance, and the worst part is, there's no simple way to parallelize the logic code that is typically implemented in a scripting language, so you end up really hurting without many options. What's dumb is that most of these things don't need to be dynamically allocated nor does the language need to be dynamically typed.
|
# ? Sep 15, 2012 06:41 |
|
As far as I know, most of the frame rate issues in late game Supreme Commander 1 came from lua. Not the rendering or anything, the path finding and AI for every little unit.
|
# ? Sep 15, 2012 06:45 |
|
Well, a lot of that was because they didn't properly deconstruct dead units. Each unit corpse still runs full ai scripts and everything as if it were alive. They might also keep going after you reclaim the corpses, but I'd have to look that one up.
|
# ? Sep 15, 2012 06:49 |
|
I wonder how much of Valve's choice of Squirrel for Left 4 Dead 2 and Portal 2 had to do with its reference counted memory management. It's hard to find information about Squirrel's real-world use compared to Lua. I adopted Squirrel for my current project, but it's not a game and so I can't speak to any performance benefits. However, I prefer Squirrel's API as well as its explicit slot creation over Lua's behavior in which undefined variables don't generate an error.
|
# ? Sep 15, 2012 08:36 |
|
yaoi prophet posted:Now I want to know what happens if you try drawing it onto a canvas and then pixel introspecting. That doesn't work for animated GIFs unless you time it properly with the browser. And then you lose the whole IE6 compatibility junk that's the gimmick of this library.
|
# ? Sep 15, 2012 08:46 |
|
Toady posted:I wonder how much of Valve's choice of Squirrel for Left 4 Dead 2 and Portal 2 had to do with its reference counted memory management. It's hard to find information about Squirrel's real-world use compared to Lua. I adopted Squirrel for my current project, but it's not a game and so I can't speak to any performance benefits. However, I prefer Squirrel's API as well as its explicit slot creation over Lua's behavior in which undefined variables don't generate an error. code:
|
# ? Sep 15, 2012 08:49 |
|
Suspicious Dish posted:
Well what if the next Squirrel update wants to use smart integers
|
# ? Sep 15, 2012 09:19 |
|
I don't know the reason for the other types, but SQChar's underlying type changes when compiled with UCS-2/UTF-16 support.
|
# ? Sep 15, 2012 09:55 |
|
Toady posted:I don't know the reason for the other types, but SQChar's underlying type changes when compiled with UCS-2/UTF-16 support. This is the real horror.
|
# ? Sep 15, 2012 10:20 |
|
What the hell is this http://phpjs.org/
|
# ? Sep 15, 2012 11:22 |
|
Biowarfare posted:What the hell is this http://phpjs.org/ Well, sometimes you just want to JavaScript code:
JavaScript code:
|
# ? Sep 15, 2012 11:35 |
|
Wheany posted:Well, sometimes you just want to http://phpjs.org/functions/echo:391 WHY
|
# ? Sep 15, 2012 11:40 |
|
Their code contribution process is pasting code in wordpress comments. Just want to point that out. http://phpjs.org/pages/develop The comments on this page are great http://phpjs.org/contributions/add/
|
# ? Sep 15, 2012 11:59 |
|
Oh, that reminds me: underscore.py
|
# ? Sep 15, 2012 13:38 |
|
|
# ? May 29, 2024 08:14 |
|
Civil Twilight posted:Oh, that reminds me: underscore.py quote:NOTE: It's obvious that python already has nearly all features of underscore library built-in. I'm not trying to fill any gap in python. Super.
|
# ? Sep 15, 2012 13:55 |