Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
npe
Oct 15, 2004
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.

Adbot
ADBOT LOVES YOU

That Turkey Story
Mar 30, 2003

Vanadium posted:

Clay looks like it shares some DNA with Haskell, so I'm all for it :v:

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

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

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!

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Optimus Prime Ribs posted:

No version control of any kind. :downs:

git init
or
hg init

Do it now.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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 :)

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



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.

Zombywuf
Mar 29, 2008

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.

Opinion Haver
Apr 9, 2007

Optimus Prime Ribs posted:

Well at least it wasn't all hand written then.
I still don't know why the hell someone thought using that was a good idea though.

What exactly is wrong with it?

Optimus Prime Ribs
Jul 25, 2007

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:
.myLink {
  width: 50px;
  height: 50px;
  background: url("/img/butts.gif") no-repeat;
}

.myLink:hover {
  background-position: 0 -50px;
}

McGlockenshire
Dec 16, 2005

GOLLOCKS!

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? :psyduck:

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.

That Turkey Story
Mar 30, 2003

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.

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.

Nothing in C++ required this approach. You don't need a scripting language to avoid misusing inheritance.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

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.

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.

Now I want to write an RTS in Python.

DStecks
Feb 6, 2012

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.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



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.

ToxicFrog
Apr 26, 2008


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.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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 :v:

That Turkey Story
Mar 30, 2003

Otto Skorzeny posted:

One of the reasons it bogs down so much late in long running games :v:

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.

Bunny Cuddlin
Dec 12, 2004
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."

PhonyMcRingRing
Jun 6, 2002

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.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Gigantic Slut Man posted:

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."
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.

akadajet
Sep 14, 2003

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.

ToxicFrog
Apr 26, 2008


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

pseudorandom name
May 6, 2007

Gigantic Slut Man posted:

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."

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

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
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.

Opinion Haver
Apr 9, 2007

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.

That Turkey Story
Mar 30, 2003

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.

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.)

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.

Serenade
Nov 5, 2011

"I should really learn to fucking read"
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.

dis astranagant
Dec 14, 2006

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.

Toady
Jan 12, 2009

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.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

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.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

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:
const SQChar *
SQInteger
SQFloat
SQBool
Why does every project ever make its own stupid typedefs?

Amarkov
Jun 21, 2010

Suspicious Dish posted:

code:
const SQChar *
SQInteger
SQFloat
SQBool
Why does every project ever make its own stupid typedefs?

Well what if the next Squirrel update wants to use smart integers :colbert:

Toady
Jan 12, 2009

I don't know the reason for the other types, but SQChar's underlying type changes when compiled with UCS-2/UTF-16 support.

Zombywuf
Mar 29, 2008

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.

Impotence
Nov 8, 2010
Lipstick Apathy
What the hell is this http://phpjs.org/

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Biowarfare posted:

What the hell is this http://phpjs.org/

Well, sometimes you just want to
JavaScript code:
var butt = array();
array_push(butt, "poop", "fart");
instead of

JavaScript code:
var butt = [];
butt.push("poop", "fart");

Impotence
Nov 8, 2010
Lipstick Apathy

Wheany posted:

Well, sometimes you just want to
JavaScript code:
var butt = array();
array_push(butt, "poop", "fart");
instead of

JavaScript code:
var butt = [];
butt.push("poop", "fart");

http://phpjs.org/functions/echo:391 :psyduck: WHY

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
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/

Civil Twilight
Apr 2, 2011

Oh, that reminds me: underscore.py

Adbot
ADBOT LOVES YOU

Jonnty
Aug 2, 2007

The enemy has become a flaming star!


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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply