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.
 
  • Locked thread
HoboMan
Nov 4, 2010

i pulled back the curtain and all that this fancy ecmascript "compiles" into is literally a bunch of string evals

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

also this "minified" script still has all the whitesapce and really long-rear end function names in these eval strings

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
current tps: POCing/prototyping some stuff in django and it seems way easier to get up and running than what i'm used to (pyramid)

how bad actually is it?

cinci zoo sniper
Mar 15, 2013




Mr SuperAwesome posted:

current tps: POCing/prototyping some stuff in django and it seems way easier to get up and running than what i'm used to (pyramid)

how bad actually is it?

eh, it's like a double whopper with an actually healthy salad

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

hackbunny posted:

well, for one, you have to make a closure around all variables that might be affected by an unwind visual c++ on x86 elegantly sidesteps the issue by just loading the original ebp lol. or do you mean you actually use msvcrt (and its abi) on windows and you have to structure code exactly like visual c++ because :wtf: I figure at some point it must be simply less effort to just write your own libc (fake edit: yep you do :monocle: hats off, that's no mean feat)

yeah, when i saw how much work they were putting into it i suggested exactly that, that they consider just writing their own personality, but they really wanted to match the abi for some reason, and quelle surprise they ended up loving around with cleanup entry ordering for months because msvcrt apparently has some undocumented and probably unnecessary requirements about that

honestly we should write our own personality for libUnwind, too, the gxx personality requires a ton of code size overhead that we could at least shift into the unwind tables

just saving the original frame pointer and making sure things get spilled into it instead of kept in callee-save registers is 100% the right way to compile that kind of non-escaping closure

hackbunny posted:

I hadn't realized that clang never had -fasynchronous-exceptions. scratch my earlier "all major compilers" then

i think we might have the really basic support, so if you throw an async exception from a callee it works and it's just local exceptions that the support is weak for. i can't remember, though

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

rjmccall posted:

yeah, when i saw how much work they were putting into it i suggested exactly that, that they consider just writing their own personality, but they really wanted to match the abi for some reason, and quelle surprise they ended up loving around with cleanup entry ordering for months because msvcrt apparently has some undocumented and probably unnecessary requirements about that

well there are good* reasons to match the ABI, like the fact that some libraries are only available as static libraries, or otherwise mixing code compiled with clang with code compiled with msvc. it also means piggybacking on the major (I won't say "native" as windows tries hard to be compiler-agnostic and imo largely succeeds) platform toolset: linker, debugger, c and c++ runtimes and related debugger magic (like visual studio's stl container inspectors), etc. besides, writing a C runtime for windows must be a really thankless task, as basically nobody but microsoft and borland has done it (lcc doesn't count because theirs is poo poo)

as a bonus, it doubles as documentation of a notoriously undocumented ABI, so yay clang for going to these insane lengths

rjmccall posted:

just saving the original frame pointer and making sure things get spilled into it instead of kept in callee-save registers is 100% the right way to compile that kind of non-escaping closure

it could be forbidden by the platform abi maybe, as a non-standard stack frame layout? all I remember clearly from reverse engineering is that on x86, __except filter expressions and __finally blocks are emitted as blocks in the enclosing function, in true "C as a fancy macro assembler" fashion, while on all other platforms they are stand alone functions that operate on a closure

Luigi Thirty
Apr 30, 2006

Emergency confection port.

here's a fun thing i added to the jaguar program



I wanted to add a text layer to it. I searched around and found a bitmap of the atari 8-bit font in 16x16 format. I converted it to a 256x256 1bpp raw image and rescaled it to make an 8x8 font too. I added an 320x200x1 pixel buffer and set it up so it's drawn in front of the background layer. I wrote some blit routines to draw 8x8 and 16x16 characters from the bitmaps - now I have a simple text layer with two sizes of fonts.

once again surprised at how easy the blitter is to program to do that compared to how dumb the rest of the architecture is

code:
void BLIT_16x16_font_glyph(uint8_t *destination, uint8_t x, uint8_t y, uint8_t *source, uint8_t c)
{
  //Blit a glyph from an 16x16 font sheet.
  //A sheet is 256x256px = 16x16 glyphs.

  uint16_t source_x = (c * 16) % 256;
  uint16_t source_y = (c & 0xF0) + 128;
  
  MMIO32(A1_BASE)   = (long)destination;	//pixel buffer to write to
  MMIO32(A1_PIXEL)  = BLIT_XY(x, y);		//pixel offset to write to
  MMIO32(A1_FPIXEL) = 0;
  MMIO32(A1_FLAGS)  = PITCH1 | PIXEL1 | WID320 | XADDPIX | YADD0;	//contiguous pixels, 1bpp, 320px wide pixel buffer, increment by 1 pixel per inner loop
  MMIO32(A1_STEP)   = BLIT_XY(320-16, 0);	//after drawing 16 pixels, advance the pointer to the next scanline of the pixel buffer
  
  MMIO32(A2_BASE)   = (long)source;		//bitmap we're reading from
  MMIO32(A2_PIXEL)  = BLIT_XY(source_x, source_y);	//pixel location of (0,0) in the character
  MMIO32(A2_STEP)   = BLIT_XY(256-16, 0);	//after drawing 16 pixels, advance the pointer to the next scanline of the character
  MMIO32(A2_FLAGS)  = PITCH1 | PIXEL1 | WID256 | XADDPIX | YADD0;	//contiguous pixels, 1bpp, 256px wide bitmap, increment by 1 pixel per inner loop
  
  MMIO32(B_COUNT)   = BLIT_XY(16, 16);	//blit 16x16 pixels

  //SRCEN and DSTEN must be enabled for blits below 8bpp
  MMIO32(B_CMD)     = SRCEN | DSTEN | UPDA1 | UPDA2 | LFU_REPLACE; //read from the source and destination, enable A1_STEP and A2_STEP, destination = source
}

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

hackbunny posted:

well there are good* reasons to match the ABI, like the fact that some libraries are only available as static libraries, or otherwise mixing code compiled with clang with code compiled with msvc. it also means piggybacking on the major (I won't say "native" as windows tries hard to be compiler-agnostic and imo largely succeeds) platform toolset: linker, debugger, c and c++ runtimes and related debugger magic (like visual studio's stl container inspectors), etc. besides, writing a C runtime for windows must be a really thankless task, as basically nobody but microsoft and borland has done it (lcc doesn't count because theirs is poo poo)

iirc a lot of this was done by the chromium team, and yeah, it's quite possible that the static library thing especially was really important to them

i assume they wouldn't need to replace the entire c runtime, just have those functions advertise that they're using a different personality, right?

hackbunny posted:

as a bonus, it doubles as documentation of a notoriously undocumented ABI, so yay clang for going to these insane lengths

for sure

hackbunny posted:

it could be forbidden by the platform abi maybe, as a non-standard stack frame layout? all I remember clearly from reverse engineering is that on x86, __except filter expressions and __finally blocks are emitted as blocks in the enclosing function, in true "C as a fancy macro assembler" fashion, while on all other platforms they are stand alone functions that operate on a closure

on some conceptual level there isn't much difference between taking a frame pointer and taking a pointer to a struct that just happens to have the layout of some function's call frame. but yeah, it does add substantial complexity to the backend to directly depend on the layout of a function; you have to compile functions in a specific order and propagate information between them, which otherwise is unnecessary and usually actively counter to the design. on the other hand having to form a closure isn't really zero-cost so

the issue that the sub-functions are actually emitted contiguously with the main function is another of those "this is not really what we want but it's a lot of otherwise-unnecessary complexity to do it any other way" sorts of things. ideally everything related to exception handling would be in a completely different section so that it didn't interfere with the page-level locality of the normal path, but now you're talking about functions having multiple address ranges for various kinds of tooling and it all becomes a huge mess

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I should look into how Common Lisp implementations deal with the condition system, which supports restarting

floatman
Mar 17, 2009
Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

rjmccall posted:

i assume they wouldn't need to replace the entire c runtime, just have those functions advertise that they're using a different personality, right?

correct! but the microsoft C runtime (until the "universal runtime" refactoring, which split the core C runtime from the compiler intrinsics library) was never meant to be used by other compilers, and they freely changed standard conformance and even the ABI from one version to the next. the "funniest" (in the "funniest home videos" sense of a football hitting someone in the crotch) one is probably msvcrt.dll, which while continuously upgraded with the latest bells and whistles, has to retain backwards compatibility with Visual Studio 6. the bits that have been updated, but if put in msvcrt.dll would break this compatibility, are distributed as a static library, confusingly merged with the msvcrt.dll import library (which is only available in the Windows driver kit, the Visual Studio version of msvcrt.lib does not link to msvcrt.dll). it took me weeks to explain this to the mingw-w64 guys and steer them away from the age old habit of blindly linking to msvcrt.dll

plus msvcrt has always had a chronic lack of extensions that are very common elsewhere, and I've always been surprised that nobody has tried to port one of the major multiplatform libcs to windows cygwin doesn't count

rjmccall posted:

but now you're talking about functions having multiple address ranges for various kinds of tooling and it all becomes a huge mess

I've seen link time optimization do worse

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
I used to work with a guy who always (and insistently) pronounced C++ as simply "c plus."

The devil couldn't have conceived of a better way to inflame everyone's autism than to leave such a commonly ingrained phrase sequence incomplete.

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news

ynohtna posted:

I used to work with a guy who always (and insistently) pronounced C++ as simply "c plus."

The devil couldn't have conceived of a better way to inflame everyone's autism than to leave such a commonly ingrained phrase sequence incomplete.

lol this owns

redleader
Aug 18, 2005

Engage according to operational parameters
"depreciated"

cinci zoo sniper
Mar 15, 2013




floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

yes, in latvian

Doom Mathematic
Sep 2, 2008

ynohtna posted:

I used to work with a guy who always (and insistently) pronounced C++ as simply "c plus."

The devil couldn't have conceived of a better way to inflame everyone's autism than to leave such a commonly ingrained phrase sequence incomplete.

People in my department routinely call C++ "C".

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

Yyyup.

jesus WEP
Oct 17, 2004


ynohtna posted:

I used to work with a guy who always (and insistently) pronounced C++ as simply "c plus."

The devil couldn't have conceived of a better way to inflame everyone's autism than to leave such a commonly ingrained phrase sequence incomplete.
god drat im gonna start doing this haha

cinci zoo sniper
Mar 15, 2013




redleader posted:

"depreciated"

codeing

AggressivelyStupid
Jan 9, 2012

floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

https://twitter.com/mariancall/status/905485243620114432

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

"implement" replacing any of the words make, use, build

cinci zoo sniper
Mar 15, 2013




prisoner of waffles posted:

"implement" replacing any of the words make, use, build
same for "adjust"

The_Franz
Aug 8, 2003

floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

c octothorpe

LinYutang
Oct 12, 2016

NEOLIBERAL SHITPOSTER

:siren:
VOTE BLUE NO MATTER WHO!!!
:siren:

HoboMan posted:

i pulled back the curtain and all that this fancy ecmascript "compiles" into is literally a bunch of string evals

You configured yr compiler wrong

simble
May 11, 2004

i like to call it c pound sometimes for funsies

CPColin
Sep 9, 2003

Big ol' smile.
C but after the end of this sentence, D.

akadajet
Sep 14, 2003

floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

c pound ...

... ed in the butt by anders hejlsberg

cinci zoo sniper
Mar 15, 2013




c double plus

quiggy
Aug 7, 2010

[in Russian] Oof.


d flat

Xarn
Jun 26, 2015

Doom Mathematic posted:

People in my department routinely call C++ "C".

:suicide:

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

floatman posted:

Guys,
Has anybody every heard C# pronounced as "C hashtag" yet?

No but I'm going to start doing that in standups now.

CPColin
Sep 9, 2003

Big ol' smile.
*pronounces "C" slightly out of key with the rest of the sentence*

FamDav
Mar 29, 2008

i wonder if kids are going to think hashtag is some weird german loanword

kdrudy
Sep 19, 2009

C increment

Luigi Thirty
Apr 30, 2006

Emergency confection port.

IT'S HERE



the flash cart is somewhere between me and poland :(

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
jesus hellfucking christ what is that goddamn controller garbage

Luigi Thirty
Apr 30, 2006

Emergency confection port.

the theory at the time was "video games are complex so they're gonna need more buttons"

sega responded with a 6-button controller
the snes controller already had a million buttons
atari bolted a phone keypad onto the rear end end of a 3-button controller and packed overlays in with games that came unstuck if you looked at them wrong

realizing their mistake, they soon released... the Jaguar Pro Controller



the d-pad is fine and the buttons are responsive, the controller is just too goddamn big and the phone keypad is impossible to use in the middle of a game

Sapozhnik
Jan 2, 2005

Nap Ghost
tbf modern console controllers could stand to have a few more buttons on the back grip like the ones that the steam controller has

LinYutang
Oct 12, 2016

NEOLIBERAL SHITPOSTER

:siren:
VOTE BLUE NO MATTER WHO!!!
:siren:
how is a phone keypad useful on a game controller

Adbot
ADBOT LOVES YOU

Plank Walker
Aug 11, 2005
atari could finally make a good E.T. game

  • Locked thread