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
Arsenic Lupin
Apr 12, 2012

This particularly rapid💨 unintelligible 😖patter💁 isn't generally heard🧏‍♂️, and if it is🤔, it doesn't matter💁.


Zopotantor posted:

Just dump in it hex. Kids these days, never had to read a core dump to figure out why their program doesn’t work. :corsair:

Hex, bah. Octal.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ratbert90 posted:

Jesus gently caress stop creating duplicated code you fucks! Has anybody heard of a function before?

If you just say this you'll end up with five copies of the same function.

FlapYoJacks
Feb 12, 2009

ultrafilter posted:

If you just say this you'll end up with five copies of the same function.

It's already happened! :argh:

FlapYoJacks
Feb 12, 2009

Zopotantor posted:

Just dump in it hex. Kids these days, never had to read a core dump to figure out why their program doesnt work. :corsair:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

more falafel please
Feb 26, 2005

forums poster

ratbert90 posted:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

The framebuffer is a fancy graphical API.

nielsm
Jun 1, 2009



ratbert90 posted:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

Real men race the beam and write directly to the DAC registers.

FlapYoJacks
Feb 12, 2009

nielsm posted:

Real men race the beam and write directly to the DAC registers.

The first embedded Linux job I had was working on the Marcum LX9 sonar.

My boss did exactly that because going from a sonar ping -> framebuffer -> LCD was too slow. He wanted time between sonar ping -> LCD to be less than 5ms.

Falcorum
Oct 21, 2010

ratbert90 posted:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

Ah, I see that you're familiar with the graphics standard library proposal for C++

raminasi
Jan 25, 2005

a last drink with no ice

RPATDO_LAMD posted:

Rust has one!

Rust's println! macro basically just calls rust's version of ToString on every argument and then shoves all those into the format string, which AFAIK is a pretty much foolproof way to do printf entirely type-safely in any lang.
(Actually it calls 'fmt', which doesn't return a string but instead writes text to a "formatter" object, I guess like a C++ stream kinda thing? Presumably this helps to avoid creating a million unnecessary strings at runtime. And then there are a bunch of different functions that have to be defined on the type for it to work with the other printf specifiers like printing in binary or hexadecimal.)

How does it validate that e.g. the "%d" in the format string corresponds to an argument with a type compatible with %d?

necrotic
Aug 2, 2005
I owe my brother big time for this!

raminasi posted:

How does it validate that e.g. the "%d" in the format string corresponds to an argument with a type compatible with %d?

Types implement their own formatter to be printable with the macro. There is no %d, only {} with some modifiers.

https://doc.rust-lang.org/std/fmt/index.html

It's a compiler error (iirc) if the proper trait is not implemented.

necrotic fucked around with this message at 00:14 on Mar 27, 2020

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

raminasi posted:

How does it validate that e.g. the "%d" in the format string corresponds to an argument with a type compatible with %d?

Format strings must be literals, and there's a magic compiler macro that (at compile-time) turns a constant string into a type-safe representation of the string and the args that it requires.

Carbon dioxide
Oct 9, 2012

https://i.imgur.com/vX0I51B.mp4

Jazerus
May 24, 2011


sometimes it's the only solution

Tei
Feb 19, 2011

ratbert90 posted:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

On the C64 the graphic memory started at C000, and the text terminal at something like 0EF0 or something like that. To see a A on the screen you would write a byte on the right memory cell.

Is too bad, because had they emulated a 80 colums screen, and given a interface to write on that terminal (and maybe peek on it), on separate memory inside the VIC, it would have made the C64 more useful.

Is also kind of sad the C64 released with a tape, instead of directly with a disc drive. Disc access (being random) is much more useful and allow to write better OS.

CPM and maybe even MS-DOS.

The 6502 had not concept of ring 0 or other protected memory for the OS. It would have made it safer to have a way to turn RAM into ROM until the next reboot.

So the C64 + a slighly better VIC (with 80 columns terminal)+ native disc drive + the ability to lock RAM into ROM, with ms-dos. That would have been a great machine.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Tei posted:

On the C64 the graphic memory started at C000, and the text terminal at something like 0EF0 or something like that. To see a A on the screen you would write a byte on the right memory cell.
Graphics memory could be located anywhere based on paging, same with the text screen. By default the text was at $0400, though.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Tei posted:

On the C64 the graphic memory started at C000, and the text terminal at something like 0EF0 or something like that. To see a A on the screen you would write a byte on the right memory cell.

Is too bad, because had they emulated a 80 colums screen, and given a interface to write on that terminal (and maybe peek on it), on separate memory inside the VIC, it would have made the C64 more useful.

Is also kind of sad the C64 released with a tape, instead of directly with a disc drive. Disc access (being random) is much more useful and allow to write better OS.

CPM and maybe even MS-DOS.

The 6502 had not concept of ring 0 or other protected memory for the OS. It would have made it safer to have a way to turn RAM into ROM until the next reboot.

So the C64 + a slighly better VIC (with 80 columns terminal)+ native disc drive + the ability to lock RAM into ROM, with ms-dos. That would have been a great machine.

It's too bad it didn't have SLI support as well

lobsterminator
Oct 16, 2012




Tei posted:

On the C64 the graphic memory started at C000, and the text terminal at something like 0EF0 or something like that. To see a A on the screen you would write a byte on the right memory cell.

Is too bad, because had they emulated a 80 colums screen, and given a interface to write on that terminal (and maybe peek on it), on separate memory inside the VIC, it would have made the C64 more useful.

Is also kind of sad the C64 released with a tape, instead of directly with a disc drive. Disc access (being random) is much more useful and allow to write better OS.

CPM and maybe even MS-DOS.

The 6502 had not concept of ring 0 or other protected memory for the OS. It would have made it safer to have a way to turn RAM into ROM until the next reboot.

So the C64 + a slighly better VIC (with 80 columns terminal)+ native disc drive + the ability to lock RAM into ROM, with ms-dos. That would have been a great machine.

You are pretty much describing C128, but it was released at the same time as the Amiga so it was obsolete on launch so it never got proper support.

It was also a weird beast with two CPUs; Z80 for CP/M mode and 6502 for the normal Commodore mode. I have the 128D desktop version sitting in my closet.

cynic
Jan 19, 2004



ultrafilter posted:

If you just say this you'll end up with five copies of the same function.

All other developers are deranged and unfortunately the key part of my job is un-deranging all their code and trying to train them in the ways of not loving initialising the same drat giant array inside a loop, reimplementing upsert code badly when it was already gracefully solved and in fact used in the same class, and cutting and pasting the same drat thing three times so your method is 1000 lines long.

feedmegin
Jul 30, 2008

ratbert90 posted:

Back in my day we wrote to the framebuffer directly! No bullshit fancy graphical APIs for me!

I mean, and speaking as one of the original developers of Qt/Embedded, someones gotta develop those APIs even today and if you don't have a GPU you still end up doing exactly that.

Faith For Two
Aug 27, 2015

DELETE CASCADE posted:

as far as i'm concerned, C doesn't have types. it has things that look like types, but really they are just instructions to the compiler on how much memory to allocate. they don't otherwise resemble an actual type system


C/C++ compilers don't necessarily target your hardware, they target an "abstract machine" specified in the C or C++ standard.
The strict aliasing rule is a pretty cool example of this. Basically, typecasts are a footgun.

Some examples of the strict aliasing rule in action:
different levels of optimization give you different results.
-O0 gives you the intuitive answer
-O2 gives you... something.
https://godbolt.org/z/a7ZZGW
https://godbolt.org/z/jqLz6u


First example is based heavily off an example from this talk https://www.youtube.com/watch?v=Nn7zugKc32Q
Second example is heavily based off of an example here https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type-punning

Faith For Two
Aug 27, 2015
code:
//inside module.h

err_code_t AppGetId(uint32_t Id, Record_t * Rec);
code:
//inside module.c

/*************************************************************************
* \brief AppGetId
*            Get the data with matching ID.
*
* \param[in] uint32_t data ID to retrieve
* \param[in] Record_t * Record returned here on success
*
* \retval err_code_t
*************************************************************************/
err_code_t AppGetId(uint32_t Id, Record_t * Rec)
{
	// stuff
}
I had to fight hard to get doxygen-style comments into our style guide, but the people who authored+approved our style guide either hate doxygen or have never used doxygen before.

qsvui
Aug 23, 2003
some crazy thing
doxygen can be a bit heavy handed

Absurd Alhazred
Mar 27, 2010

by Athanatos
https://twitter.com/manicode/status/1246497036389793792

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

I'm slightly tempted to learn COBOL and try to help out

Slightly

Suspicious Dish
Sep 24, 2011

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

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I'll start the wiki

Soricidus
Oct 21, 2010
freedom-hating statist shill

Volmarias posted:

I'll start the wiki

ok but you have to write it in cobol

there appear to be several cobol web frameworks available but i'd recommend this one as it runs on your existing z/os hardware

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Soricidus posted:

ok but you have to write it in cobol

there appear to be several cobol web frameworks available but i'd recommend this one as it runs on your existing z/os hardware

I'm partial to COBOL on Cogs myself

Munkeymon
Aug 14, 2003

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



IDK if fixed-point math is webscale tho?

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

extremely webscale

Absurd Alhazred
Mar 27, 2010

by Athanatos
https://twitter.com/eigenbom/status/1246982053918195712

Tei
Feb 19, 2011


Sounds like many people on the hardware pipeline did not understood the concept of abstraction leaking.

But that could be a good thing, if the 6 people that really understand that poo poo and use it commercially have good use of that.

I personally hate that. On the web we have an egregious example with service workers.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The point of Vulkan was for it to be a low-level API that only crazy people use directly.

That has not held up with reality, though.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Are there direct javascript bindings yet so you can use vulkan instead of webgl?

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe

Suspicious Dish posted:

The point of Vulkan was for it to be a low-level API that only crazy people use directly.

That has not held up with reality, though.

Wasn't the point of Vulkan to get an API that more closely resembles modern GPU architecture than OpenGL? Not necessarily something that was more low level

nielsm
Jun 1, 2009



Joda posted:

Wasn't the point of Vulkan to get an API that more closely resembles modern GPU architecture than OpenGL? Not necessarily something that was more low level

That, and remove all the statefulness of OpenGL.

Absurd Alhazred
Mar 27, 2010

by Athanatos

nielsm posted:

That, and remove all the statefulness of OpenGL.

To be fair, if you use the latest extensions of OpenGL or DX11, or if you use DX12 or Metal, you're going to see similar things.

MrMoo
Sep 14, 2000

Soricidus posted:

Are there direct javascript bindings yet so you can use vulkan instead of webgl?

It’s called Webgpu, generally hidden behind flags on Chome and Safari.

Suspicious Dish
Sep 24, 2011

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

Adbot
ADBOT LOVES YOU

Falcorum
Oct 21, 2010

Suspicious Dish posted:

The point of Vulkan was for it to be a low-level API that only crazy people use directly.

That has not held up with reality, though.

As a graphics dev, Vulkan's a lot nicer to work with than OGL (and to a lesser extent, than D3D). It's massively more verbose (until you build your own abstraction layer, same as you'd do with other graphics APIs anyway), but there's significantly less guessing at what the gently caress the GPU drivers are doing, and then being surprised at their "this is what you meant right" best guesses.

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