As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

[Programming] Page overflow to new thread

16566687071101

Posts

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Vaguely related, once upon a time I was dabbling with writing a roguelike, and I ended up writing something I guess I could call an ASCII blitter, because redrawing the whole screen was just too damn slow.

  • Options
    schussschuss Registered User regular
    Phyphor wrote: »
    I think a better question is why is everyone pumping so much crap through the terminal in the first place

    This. If you need more than 30fps, you're doing it wrong. What possible use case is there that needs high framerates in a terminal?

  • Options
    LD50LD50 Registered User regular
    schuss wrote: »
    Phyphor wrote: »
    I think a better question is why is everyone pumping so much crap through the terminal in the first place

    This. If you need more than 30fps, you're doing it wrong. What possible use case is there that needs high framerates in a terminal?

    Rendering Doom with an ascii raytracing renderer?

  • Options
    GilgaronGilgaron Registered User regular
    I've been watching some Casey muratori stuff recently following his amusing rant about windows terminal frame rate.
    https://mobile.twitter.com/cmuratori/status/1411437902802808832

    I think he just doesn't quite understand how good a programmer he is. It seems like a common theme throughout his work/videos, that he thinks he's average so he gets mad everyone else doesn't live up to his standards (not that he doesn't have a point!)

    It is always fun watching people that are unaware of their own talent level. "Oh that's easy," they demonstrate in a YouTube video effortlessly performing an action of deft hands that is easy for someone who has been doing it 10 years and too subtle for anyone without 5 years of experience to really catch what they just saw.

  • Options
    schussschuss Registered User regular
    Gilgaron wrote: »
    I've been watching some Casey muratori stuff recently following his amusing rant about windows terminal frame rate.
    https://mobile.twitter.com/cmuratori/status/1411437902802808832

    I think he just doesn't quite understand how good a programmer he is. It seems like a common theme throughout his work/videos, that he thinks he's average so he gets mad everyone else doesn't live up to his standards (not that he doesn't have a point!)

    It is always fun watching people that are unaware of their own talent level. "Oh that's easy," they demonstrate in a YouTube video effortlessly performing an action of deft hands that is easy for someone who has been doing it 10 years and too subtle for anyone without 5 years of experience to really catch what they just saw.

    Or rather, have people make something work somewhere that isn't local. *ducks*

    More realistically, programming skills are like being able to sculpt any curve - useful, but useless if you don't have a statue you'd like to make.

  • Options
    djmitchelladjmitchella Registered User regular
    .
    schuss wrote: »
    Phyphor wrote: »
    I think a better question is why is everyone pumping so much crap through the terminal in the first place

    This. If you need more than 30fps, you're doing it wrong. What possible use case is there that needs high framerates in a terminal?

    Typing? I tried using the new windows terminal (rather than classic cmd.exe) and the latency on cursor movement / autocomplete was more than I could put up with.

  • Options
    DehumanizedDehumanized Registered User regular
    I expect my terminal to be able to keep up with my refresh rate, beyond that I do not care.

  • Options
    LD50LD50 Registered User regular
    I expect my terminal to be able to keep up with my refresh rate, beyond that I do not care.

    Agreed. It needs to maintain a minimum 240 fps.

  • Options
    TelMarineTelMarine Registered User regular
    FPS in a terminal is a thing I never even considered. Eh, whatever the defaults are seem fine across the board.

    3ds: 4983-4935-4575
  • Options
    bowenbowen How you doin'? Registered User regular
    Gilgaron wrote: »
    I've been watching some Casey muratori stuff recently following his amusing rant about windows terminal frame rate.
    https://mobile.twitter.com/cmuratori/status/1411437902802808832

    I think he just doesn't quite understand how good a programmer he is. It seems like a common theme throughout his work/videos, that he thinks he's average so he gets mad everyone else doesn't live up to his standards (not that he doesn't have a point!)

    It is always fun watching people that are unaware of their own talent level. "Oh that's easy," they demonstrate in a YouTube video effortlessly performing an action of deft hands that is easy for someone who has been doing it 10 years and too subtle for anyone without 5 years of experience to really catch what they just saw.

    Dude basically wrote a god damned rendering engine "in a few days". He's the equivalent of the guy at 25 working in a trade that's putting in 100 hours a week and wondering why no one can keep up with him and it's just so easy.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    DehumanizedDehumanized Registered User regular
    I found the original Github issue and yeah, it was fine and levelheaded until he just assumed anyone who wasn't intimately familiar with the domain of shaders was an idiot. This is how you perpetuate Impostor Syndrome, and it sucks.

  • Options
    schussschuss Registered User regular
    I found the original Github issue and yeah, it was fine and levelheaded until he just assumed anyone who wasn't intimately familiar with the domain of shaders was an idiot. This is how you perpetuate Impostor Syndrome, and it sucks.

    Developers declaring themselves superior because of silly minutiae knowledge? That's never happe- oh wait.

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2021
    bowen wrote: »
    Gilgaron wrote: »
    I've been watching some Casey muratori stuff recently following his amusing rant about windows terminal frame rate.
    https://mobile.twitter.com/cmuratori/status/1411437902802808832

    I think he just doesn't quite understand how good a programmer he is. It seems like a common theme throughout his work/videos, that he thinks he's average so he gets mad everyone else doesn't live up to his standards (not that he doesn't have a point!)

    It is always fun watching people that are unaware of their own talent level. "Oh that's easy," they demonstrate in a YouTube video effortlessly performing an action of deft hands that is easy for someone who has been doing it 10 years and too subtle for anyone without 5 years of experience to really catch what they just saw.

    Dude basically wrote a god damned rendering engine "in a few days". He's the equivalent of the guy at 25 working in a trade that's putting in 100 hours a week and wondering why no one can keep up with him and it's just so easy.

    Ehhh "rendering engine" is a bit of a stretch. The only tricky bit is generating the glyphs (which he is getting windows to do). If you know how to do a spinning triangle you can probably do that in a few days sure

    Phyphor on
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2021
    Ultimately the primary difference between his implementation and the actual console app is that he spins up a DX11 context to do the rendering while the windows console is a 2D rastered thing

    And his either won't work or will be laughably slow (unsure if DX11 still includes a software rasterizer at all) if you for example, install a new GPU and don't have drivers yet. So of course it will be fast, he is offloading all of the work to the GPU. But if you're building core system tools that have to eg, come up in safe mode (or existed prior to when you could assume you have a 3D accelerator present), you can't rely on stuff like that working

    Phyphor on
  • Options
    bowenbowen How you doin'? Registered User regular
    edited July 2021
    Phyphor wrote: »
    bowen wrote: »
    Gilgaron wrote: »
    I've been watching some Casey muratori stuff recently following his amusing rant about windows terminal frame rate.
    https://mobile.twitter.com/cmuratori/status/1411437902802808832

    I think he just doesn't quite understand how good a programmer he is. It seems like a common theme throughout his work/videos, that he thinks he's average so he gets mad everyone else doesn't live up to his standards (not that he doesn't have a point!)

    It is always fun watching people that are unaware of their own talent level. "Oh that's easy," they demonstrate in a YouTube video effortlessly performing an action of deft hands that is easy for someone who has been doing it 10 years and too subtle for anyone without 5 years of experience to really catch what they just saw.

    Dude basically wrote a god damned rendering engine "in a few days". He's the equivalent of the guy at 25 working in a trade that's putting in 100 hours a week and wondering why no one can keep up with him and it's just so easy.

    Ehhh "rendering engine" is a bit of a stretch. The only tricky bit is generating the glyphs (which he is getting windows to do). If you know how to do a spinning triangle you can probably do that in a few days sure

    He's using a huge chunk of domain knowledge and working from scratch and the people he's "belittling" are likely working on production code that has large amounts of technical debt and aren't given free reign to do as they wish... so yes, that's technically correct but he's also comparing apples to oranges with what he's doing. (also yeah the safe mode shit like you mention)

    He sort of reminds me of Torvalds with how he approaches other professionals.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    if I had a dollar for every time I declared something was easy and then had to eat my words with the complexity required to make it production-ready I had overlooked

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2021
    Orca wrote: »
    if I had a dollar for every time I declared something was easy and then had to eat my words with the complexity required to make it production-ready I had overlooked

    Well there's also this. He commits several sins that simply wouldn't fly in a real app, especially something that isn't an exclusive whole-screen app like a game that can suck up all system resources it needs. A terminal should be the most background low impact thing on the system

    - does not handle DX11 context loss (that I can see anyway, and IIRC it does need to reacquire sometimes)
    - fixed scrollback size of 8192 lines. This isn't especially large or impressive, but making it resizable with how he has chosen to do it is... tricky. And, in a 32bit build he would be limited by virtual memory constraints to about 500k lines or so and practically limited to about 300k or less because he is double-mapping a buffer sized at 2kB / line to get a cheaper circular buffer
    - his pipe buffers are 16 MB. Every process he creates with his "fastpipe" method requires two of these, one for each direction. Pipe buffer sizes are typically like 4 kB
    Every time a named pipe is created, the system creates the inbound and/or outbound buffers using nonpaged pool, which is the physical memory used by the kernel
    - consuming large quantities of nonpaged pool really needs a second entry. NP pool on my windows system right now with a bunch of stuff running is 300 MB, he would increase that by 10% to run one faster output console app
    - it uses that same 16 MB as it's scrollback buffer. conhost/cmd.exe offers 8200 lines of scrollback with total combined process commit size of under 13 MB
    - it uses a 2048x2048 texture as its glyph cache. That's an additional 16 MB of GPU memory, per console, and probably another 16 MB of backing CPU memory in case of GPU context loss
    - does not actually implement anything beyond the most basic of input and output. Eg, no selection, copy/paste and so on
    - it does not implement any security whatsoever for his fast pipe scheme. In fact any process that tries to use it anywhere can be hijacked by any user (ironically the only time it can't be hijacked trivially is if his terminal launches it with the option on because the terminal will crash if it cant create the pipe. The child process might still live on though)

    Phyphor on
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    edited July 2021
    He's eating up that much nonpaged pool for a terminal? That's fucking nuts. That's "this is a prototype I'm using to fuck around", not "this is actually a good and usable way to make things work"

    The security vulnerability is just like...of course that's a problem in his implementation.

    Orca on
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    TBF he does explicitly say it is a prototype and not a real terminal, so I would probably be willing to let him slide on the security thing too. But yeah he's consuming resources willy nilly and saying "well see it's faster (when you consume everything)"

    Almost makes me want to throw something slightly more sensible together...

  • Options
    bowenbowen How you doin'? Registered User regular
    modern game developers sure play fast and loose with system resources don't they

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    DehumanizedDehumanized Registered User regular
    edited July 2021
    It's useful enough as a proof of concept. It's not like the actual terminal needs to get up to thousands of FPS performance, it just needs to kill those 5fps worst case bottlenecks that currently exist. Too bad the guy's a real goose, otherwise that issue probably could have lead to some meaningful improvements.

    Dehumanized on
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    bowen wrote: »
    modern game developers sure play fast and loose with system resources don't they

    Which is fine, games are the epitome of "allowed to take over the system", but it's certainly not the way I want any normal application to run--especially not my console.

  • Options
    PeewiPeewi Registered User regular
    I made a small thing that shows the status of my Twitch channel that I can put on my website or in a forum signature and it took me a while to get the authorization for Twitch's API set up correctly.

    Is it normal for web APIs to require authorization for stuff anyone can see on the website without even logging in?

    On the bright side, I sort of learned the basics of using cURL while getting the thing to work.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Peewi wrote: »
    Is it normal for web APIs to require authorization for stuff anyone can see on the website without even logging in?

    It's usually for rate-limiting reasons.

  • Options
    PeewiPeewi Registered User regular
    Echo wrote: »
    Peewi wrote: »
    Is it normal for web APIs to require authorization for stuff anyone can see on the website without even logging in?

    It's usually for rate-limiting reasons.

    I suppose that makes sense. The docs I read did mention there being rate limiting.

  • Options
    bowenbowen How you doin'? Registered User regular
    Orca wrote: »
    bowen wrote: »
    modern game developers sure play fast and loose with system resources don't they

    Which is fine, games are the epitome of "allowed to take over the system", but it's certainly not the way I want any normal application to run--especially not my console.

    yeah but what if I want to play doom on my terminal in safe mode

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    bowen wrote: »
    Orca wrote: »
    bowen wrote: »
    modern game developers sure play fast and loose with system resources don't they

    Which is fine, games are the epitome of "allowed to take over the system", but it's certainly not the way I want any normal application to run--especially not my console.

    yeah but what if I want to play doom on my terminal in safe mode

    Then you'll get your 5 FPS and like it! Just like we did back in the day on a 386!

  • Options
    schussschuss Registered User regular
    Echo wrote: »
    Peewi wrote: »
    Is it normal for web APIs to require authorization for stuff anyone can see on the website without even logging in?

    It's usually for rate-limiting reasons.

    Yep, not really a security mechanism, but easily allows for preventing request DDOS's/bad actor control, as well as random algos just paging endlessly through it.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Let they who never forgot adding a retry delay for API requests cast the first stone.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    ...which brings up memories of the networking class way back in the bronze age.

    Turns out having an entire classroom full of people writing their first shoddy port scanner and trying them at the same time was an excellent way to bring down the network.

  • Options
    CampyCampy Registered User regular
    Echo wrote: »
    Let they who never forgot adding a retry delay for API requests cast the first stone.

    We got a slap on the wrist from an externally integrated company just the other day.

    UI driven API calls, check.
    No caching, check.
    Instant retry, check.
    Increasing user uptake, check.
    DOSing your partner's production endpoint... Check!

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Campy wrote: »
    Echo wrote: »
    Let they who never forgot adding a retry delay for API requests cast the first stone.

    We got a slap on the wrist from an externally integrated company just the other day.

    UI driven API calls, check.
    No caching, check.
    Instant retry, check.
    Increasing user uptake, check.
    DOSing your partner's production endpoint... Check!

    We have an API with the bare minimum of "please don't murder our API". Been thinking a bit about how to do rate limiting in a distributed microservice.

  • Options
    InfidelInfidel Heretic Registered User regular
    Good chunk of my job is slowly modernizing an API product that is slammed 24/7 with 2-3k TPS and is super old bones that had obvious success more than technical resources.

    OrokosPA.png
  • Options
    InfidelInfidel Heretic Registered User regular
    Note: These are heavy calls, 1-2 second is a median with several seconds being expected for some clients.

    Working with some Google engineers one time they were like "we're seeing API responses over one second, is everything okay?" *checks* "Oh yeah, that's looking real good to us :lol:"

    OrokosPA.png
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    edited July 2021
    Yeah, due to Growth™ we have several other services behind the API that are creaking at the seams that really need a lot of attention.

    Echo on
  • Options
    schussschuss Registered User regular
    Infidel wrote: »
    Note: These are heavy calls, 1-2 second is a median with several seconds being expected for some clients.

    Working with some Google engineers one time they were like "we're seeing API responses over one second, is everything okay?" *checks* "Oh yeah, that's looking real good to us :lol:"

    Ouch. Unless it's running some serious models behind the scenes, that's rough. That said - I hear you *eyes mainframes nervously*

  • Options
    InfidelInfidel Heretic Registered User regular
    schuss wrote: »
    Infidel wrote: »
    Note: These are heavy calls, 1-2 second is a median with several seconds being expected for some clients.

    Working with some Google engineers one time they were like "we're seeing API responses over one second, is everything okay?" *checks* "Oh yeah, that's looking real good to us :lol:"

    Ouch. Unless it's running some serious models behind the scenes, that's rough. That said - I hear you *eyes mainframes nervously*

    It pretends a bunch of real-time upstream source data is one cohesive data set and RESTful when it definitely ain't. :lol:

    OrokosPA.png
  • Options
    ElaroElaro Apologetic Registered User regular
    All right, guys, hit me with your best C++ unit test frameworks?
    Campy wrote: »
    Echo wrote: »
    Let they who never forgot adding a retry delay for API requests cast the first stone.

    We got a slap on the wrist from an externally integrated company just the other day.

    UI driven API calls, check.
    No caching, check.
    Instant retry, check.
    Increasing user uptake, check.
    DOSing your partner's production endpoint... Check!

    Ohhh, that's why my project seemed sketchy! I had all of those things (except for the partner... It was a personal project)!

    Like, I had an Angular front-end sending a JSON POST request to the back-end, it would do some calculations, and send a MIDI file back to the front-end! UI driven API call, yup. No caching? Didn't know that it should be done. Instant retry, yup. Increasing user uptake? Luckily I was the only user, but had I deployed it, it would've been catastrophic!

    Thanks, Campy! I'm now a better web developer because you shared that!

    Children's rights are human rights.
  • Options
    schussschuss Registered User regular
    Infidel wrote: »
    schuss wrote: »
    Infidel wrote: »
    Note: These are heavy calls, 1-2 second is a median with several seconds being expected for some clients.

    Working with some Google engineers one time they were like "we're seeing API responses over one second, is everything okay?" *checks* "Oh yeah, that's looking real good to us :lol:"

    Ouch. Unless it's running some serious models behind the scenes, that's rough. That said - I hear you *eyes mainframes nervously*

    It pretends a bunch of real-time upstream source data is one cohesive data set and RESTful when it definitely ain't. :lol:

    That'll do it

  • Options
    SageinaRageSageinaRage Registered User regular
    edited July 2021
    I've been working on a personal project using h2 as the in-memory database while I was working on it locally. I'm at a state where I wanted to have some people look at it so I put it up on heroku. Tried to hook it up to a connected database, and basically none of them will work. Postgres has different auto_increment syntax (which is probably bad practice and I was going to change eventually, just...not yet), mysql has different foreign key syntax. I can update it to use one of these, but I was hoping to keep using h2 locally and for unit tests.

    I just really hate the balkanization of sql syntax! I've worked with oracle and sql server a good bit professionally, I knew they were pretty different. But I didn't expect all the open source ones to also have these kinds of issues! I guess I was overly optimistic.

    edit:: welp, I discovered I was just using an h2 shorthand, I got it to where it should work on mysql, and if I run the script directly on the db it does - but the automated deployment through Play fails, saying there's an incorrect table definition. :x

    SageinaRage on
    sig.gif
This discussion has been closed.