|
with enough syntax you can make Result based error handling look like exceptions
|
# ? Aug 25, 2018 03:39 |
|
|
# ? Oct 4, 2024 21:25 |
|
what’re people’s experience here learning Metal? i made a camera effects ios app using CIFilters, but it drains the crap out of the battery. it’s being beta tested and i’m trying to do something that will optimize it as quick as i can. eventually i’ll add Metal but realistically it will be after release. apparently i can still use the same CIFilters and have the drawing and view be Metal
|
# ? Aug 25, 2018 04:41 |
|
Slurps Mad Rips posted:c tp s: i've finally snapped. i've forked gnu m4 and i'm rewriting it in C++17. I know this is supposed to be a safe space and all but wha the Christ
|
# ? Aug 25, 2018 08:49 |
|
MononcQc posted:Returning errors as value is good, but you have to have a good uniform way to unambiguously be able to get contextual information from the origin of the error as a more remote observer. yet another place where Lisp gets it right, with the condition system and restarts
|
# ? Aug 25, 2018 08:53 |
|
I was going to make a post about my toy OS’ memory allocator but as usual I realized the solution while I was writing it out so instead I present my glide .obj loader drawing a spinning spaceship https://twitter.com/LuigiThirty/status/1033269878931771397 unfortunately I don’t have any way to directly record the voodoo output so I hope you like “camera pointed at screen”
|
# ? Aug 25, 2018 09:29 |
|
Good Sphere posted:what’re people’s experience here learning Metal? i made a camera effects ios app using CIFilters, but it drains the crap out of the battery. it’s being beta tested and i’m trying to do something that will optimize it as quick as i can. eventually i’ll add Metal but realistically it will be after release. apparently i can still use the same CIFilters and have the drawing and view be Metal metal is rly cool but I found that the docs are a mix of out of date, in objective-c, and confusing af.
|
# ? Aug 25, 2018 09:30 |
|
tinaun posted:with enough syntax you can make Result based error handling look like exceptions problem: writing "Ok(foo)" in a function that might fail is cumbersome, it would be much better to write "foo" and make you look at the signature to figure out that it's a Result solution: replace "Result<T, E>" with "T throws E" to trigger the above behaviour, also add a macro "throw!(foo)" which is obviously much shorter than "Err(foo)?"
|
# ? Aug 25, 2018 11:42 |
|
Good Sphere posted:what’re people’s experience here learning Metal? i made a camera effects ios app using CIFilters, but it drains the crap out of the battery. it’s being beta tested and i’m trying to do something that will optimize it as quick as i can. eventually i’ll add Metal but realistically it will be after release. apparently i can still use the same CIFilters and have the drawing and view be Metal stop doing what you're doing and make it in vulkan with moltenvk instead
|
# ? Aug 25, 2018 15:08 |
|
there's never a reason to choose metal
|
# ? Aug 25, 2018 15:09 |
|
Tankakern posted:stop doing what you're doing and make it in vulkan with moltenvk instead this but the whole app and use react native, op
|
# ? Aug 25, 2018 15:38 |
|
gonadic io posted:poo poo i've just had a great idea. make my own version of try! that automatically annotates the error with standard stack-tracey stuff. failure has a bunch of macros but i didn't see one that did this. too bad that the ? syntax is special and you can't override it with a trait or whatever like you can with + etc error-chain does this when you do chain_err, i'm pretty sure from what i can tell error-chain will be deprecated and failure is the new hot stuff but i'm not looking forward to switching, failure looks pretty anemic in comparison
|
# ? Aug 25, 2018 15:38 |
|
suffix posted:error-chain does this when you do chain_err, i'm pretty sure failure does this too with context or something, but the point is you still have to do code:
still though failure is basically Strictly Better than error chain which is why the latter is deprecated in favour of the former
|
# ? Aug 25, 2018 16:31 |
|
just wanna thank symbolic butt for posting about that programming languages coursera class earlier in this thread. i'm learning to weird via sml and liking it a lot
|
# ? Aug 25, 2018 20:39 |
|
meatpotato posted:just wanna thank symbolic butt for posting about that programming languages coursera class earlier in this thread. i'm learning to weird via sml and liking it a lot
|
# ? Aug 25, 2018 20:45 |
meatpotato posted:just wanna thank symbolic butt for posting about that programming languages coursera class earlier in this thread. i'm learning to weird via sml and liking it a lot oh right there were like a few pages of educational links some time ago that i forgot to revisit, was reading them from phone
|
|
# ? Aug 25, 2018 20:53 |
|
Luigi Thirty posted:metal is rly cool but I found that the docs are a mix of out of date, in objective-c, and confusing af. but you’re an expert now so none of that will slow you down! implement Glide atop Metal for porting your game
|
# ? Aug 25, 2018 21:17 |
|
Tankakern posted:there's never a reason to choose metal sure there is: you want to get the best possible experience for your users by using native technologies supported by the platform vendor instead of using third party wrapper libraries that exist mostly for ideological reasons
|
# ? Aug 25, 2018 21:19 |
|
meatpotato posted:just wanna thank symbolic butt for posting about that programming languages coursera class earlier in this thread. i'm learning to weird via sml and liking it a lot cinci zoo sniper posted:oh right there were like a few pages of educational links some time ago that i forgot to revisit, was reading them from phone Oh let me just search for those... RIP Can we put them in the OP?
|
# ? Aug 25, 2018 21:21 |
|
Symbolic Butt posted:a couple of online courses that made a huge impression on me:
|
# ? Aug 25, 2018 23:24 |
|
eschaton posted:but you’re an expert now so none of that will slow you down! I need to figure out how per-vertex lighting calculations work first so I can actually light my models
|
# ? Aug 25, 2018 23:25 |
|
eschaton posted:I know this is supposed to be a safe space and all but i dunno man it’s been fun so far to destroy all the old busted code and get this working on windows Slurps Mad Rips fucked around with this message at 04:01 on Aug 26, 2018 |
# ? Aug 26, 2018 03:33 |
|
speaking of things that are busted, the entire STL in VC6
|
# ? Aug 26, 2018 03:43 |
|
Luigi Thirty posted:speaking of things that are busted, the entire STL in VC6 yeah thats dinkumware for you. MS doesn’t contract with them anymore. it’s also why lots of gamedevs wrote their own stdlib stuff for the next decade or so if you need an STL for that time period I recommend you look into STLPort. there’s deffo a version that supports vc6 somewhere on sourceforge. also maybe grab the last version of boost to support vc6 so you can get decent string/vector implementations
|
# ? Aug 26, 2018 04:01 |
|
literally anything would be better than the existing vector, which actually didn’t work until I installed VC6 service pack 6 now getline doesn’t work! I will look at ancient boost e: ok google says 1.36 is the last one that explicitly supports VC6 and 1.34 is the last one precompiled for it, so that’s 2008ish Luigi Thirty fucked around with this message at 04:19 on Aug 26, 2018 |
# ? Aug 26, 2018 04:15 |
|
eschaton posted:sure there is: you want to get the best possible experience for your users by using native technologies supported by the platform vendor instead of using third party wrapper libraries that exist mostly for ideological reasons lmao
|
# ? Aug 26, 2018 04:18 |
|
c emulator101 s: really glad I wrote all these loving tests for each and every opcode, because I'm about to refactor the poo poo out of things so I can support interrupts properly. (An interrupt can inject any one-, two-, or three-byte operation into the CPU's piss stream, not just RST operations, so, in cases where the operation doesn't already change the PC, any automatic incrementing of the PC that would normally happen has to be suppressed. All my emulation code was explicitly incrementing the PC and now has to do it implicitly so interrupt processing can skip it properly.)
|
# ? Aug 26, 2018 06:10 |
|
CPColin posted:c emulator101 s: really glad I wrote all these loving tests for each and every opcode, because I'm about to refactor the poo poo out of things so I can support interrupts properly. (An interrupt can inject any one-, two-, or three-byte operation into the CPU's piss stream, not just RST operations, so, in cases where the operation doesn't already change the PC, any automatic incrementing of the PC that would normally happen has to be suppressed. All my emulation code was explicitly incrementing the PC and now has to do it implicitly so interrupt processing can skip it properly.) ah yeah, having my main loop implicitly increment the PC seemed like a code smell, so I designed it so that each instruction is responsible for advancing the PC. this lead to a lot of bugs where I forgot to advance the PC, but I'm glad I did it. i'm totally stumped on the behavior i'm seeing currently. something is wrong. I'm currently implementing better debugging than I had previously (storing the op history in a ring buffer for inspection on failure, etc). if that doesn't solve the problem, i'll probably take a break from this because it's working to my satisfaction. there's a guide for writing an OS in rust i might try next.
|
# ? Aug 26, 2018 13:26 |
|
MALE SHOEGAZE posted:ah yeah, having my main loop implicitly increment the PC seemed like a code smell, so I designed it so that each instruction is responsible for advancing the PC. this lead to a lot of bugs where I forgot to advance the PC, but I'm glad I did it. Heh, I'm refactoring in the other direction. Each instruction right now explicitly advances the PC. That's not supposed to happen when processing an interrupt and I don't want to add "if (interrupt)" to each of my instructions, so I'm moving toward handling the PC in one place like this: if PC was set explicitly, use that else if processing an interrupt, keep PC the same else advance PC by the size of the instruction And since I wrote a test for every instruction that verifies the PC advanced, I can do this refactor safely! Whee!
|
# ? Aug 26, 2018 16:18 |
|
wouldnt it make sense to save the PC before the interrupt and then restore it afterwards? seems like that's a lot easier
|
# ? Aug 26, 2018 17:04 |
|
CRIP EATIN BREAD posted:wouldnt it make sense to save the PC before the interrupt and then restore it afterwards? seems like that's a lot easier then you have to not restore it if the interrupt instruction was a jump but do still restore it if it was a conditional jump that wasn't taken even if the jump location happens to be the same as advancing the program counter normally
|
# ? Aug 26, 2018 17:40 |
|
CPColin posted:Heh, I'm refactoring in the other direction. Each instruction right now explicitly advances the PC. That's not supposed to happen when processing an interrupt and I don't want to add "if (interrupt)" to each of my instructions, so I'm moving toward handling the PC in one place like this: ah, i misunderstood. maybe this is the source of my current issues.
|
# ? Aug 26, 2018 18:14 |
|
I'm also just realizing I have a problem with how I return from interrupts. Normally, when executing a RET operation, you want the PC to end up pointing at the instruction after the CALL that led to the RET, or you'll get stuck in a loop. When you're returning from an interrupt handler, you're returning to an instruction that isn't CALL (or one of the conditional calls), so you'd better keep the PC where it was! So I guess I need to add an "if returning to a CALL, RST, etc., increment PC" check, ugh.
|
# ? Aug 26, 2018 18:52 |
|
ah okay. i get what you're talking about now. in the emulator101 we don't implement full interrupts, just RST 1 and RST 2, and it doesn't matter if you increment the PC there since the executed code just returns to the stored PC.
|
# ? Aug 26, 2018 19:12 |
|
Yeah, I think this is a case where the 8080 data book gave me the wrong impression. For CALL and its variants, it says, "a return address is pushed onto the stack for use by the RETURN instructions." For RST, it says, "The contents of the program counter are pushed onto the stack, providing a return address for later use by a RETURN instruction." I think it should mention that the return address should be the current PC, when processing an interrupt, and the address of the subsequent instruction, when not processing an interrupt. That's how I'm going to do it, I guess, and I'll see what happens! But yeah, the only reason this is an issue is because I'm making it harder on myself by supporting RST in normal program flow and supporting interrupts that aren't RST.
|
# ? Aug 26, 2018 19:35 |
|
aggh i fixed it, my SHLD instruction was wrong. only found it with manual inspection. not an interesting bug, just a simple mistake. i think attract mode is working! e: hmm well it seems the alien spaceships don't take damage in attract mode. that must be wrong? DONT THREAD ON ME fucked around with this message at 22:23 on Aug 26, 2018 |
# ? Aug 26, 2018 22:11 |
|
Oof, started to get disheartened by how slow this code is, to the point where I was about to quit, because it would take forever to draw each frame. Wisely got a profiler going and discovered a fun quirk in Ceylon:code:
but hooray for profilers Edit: It used to take five minutes for my emulator to reach the first "one-second delay" loop and now it just took fifteen seconds. And most of that was printing the output from the disassembler.
|
# ? Aug 27, 2018 01:42 |
|
CPColin posted:c emulator101 s: pre:U IS OPERATIONALCPU IS OPERATIONALCPU IS OPERATIONALCPU IS OPERATIONALCPU IS OPERA e: this is your fault, MALE SHOEGAZE, but seriously thanks for the inspiration to do a neat side project ctps: cpu.fs contains little more than a 950 line tail-recursive function Night Shade fucked around with this message at 01:57 on Aug 27, 2018 |
# ? Aug 27, 2018 01:54 |
|
you people and your 8080s. try implementing something fun and esoteric, like a belt machine. if your want real fun, build the whole thing in VHDL after your emulator is working. i did that for a masters course and still have nightmares
|
# ? Aug 27, 2018 04:35 |
|
Java image processing is loving esoteric as all hell, but it's nice it has at least some capacity for me to copy my video RAM straight into an image raster
|
# ? Aug 27, 2018 05:31 |
|
|
# ? Oct 4, 2024 21:25 |
|
(lol except the bytes in the video RAM are packed little-endian and Java is expecting big-endian whoops)
|
# ? Aug 27, 2018 05:47 |