Using COBOL to make a video game!
21:36
2022 in Programming Languages
16:43
Пікірлер
@clebersondot-net
@clebersondot-net 6 күн бұрын
nice!
@Germisstucklmao
@Germisstucklmao 9 күн бұрын
I saw the GitHub update and just knew there would be a video soon. Not even a day later, this showed up on my feed . Keep up the good work man
@Idivichkg
@Idivichkg 9 күн бұрын
"depth shader" to note
@contextfree
@contextfree 9 күн бұрын
What's a depth shader? I did almost demo depth testing turned on or off in pipelines here but chose to that out of the video.
@Idivichkg
@Idivichkg 9 күн бұрын
@contextfree imagine you study rust after python and use bevy and in the process you see something that shouldn't be like that. And I was very glad that I found a solution for it.
@jrgalyen
@jrgalyen 10 күн бұрын
Did I hear you correctly when you have C3 compiling to rust? Or was that rust compatibility. Curious on your opinion of C3 safety and bridging the gap between C and Rust (not full safety, but more than C/C++?). First I have heard of C3
@contextfree
@contextfree 10 күн бұрын
I'm compiling C3 to WebAssembly then running it from either Rust or JS. I haven't explored C3 safety features much, but it is nicer to use than plain C, I'd say.
@ihatesun
@ihatesun 10 күн бұрын
Cool.
@zayn8649
@zayn8649 10 күн бұрын
very cool video! I'm looking forward to see what you cook up next
@glebbash
@glebbash 10 күн бұрын
Nice progress on Taca. 💪 I've never heard lib (as in Raylib) pronounced as "lie b", it seems everyone says "leeb". Even though both kinda make sense.🤷‍♂️
@contextfree
@contextfree 10 күн бұрын
Yeah, different people pronounce "lib" differently. I'm ok with that. Thanks much for the encouragement on Taca. I've been wanting something vaguely like this for a long time. And the other projects out there so far don't quite scratch my itch.
@xfcisco
@xfcisco 10 күн бұрын
please make more videos on c3 It's very interesting but not many people are talking about it!
@contextfree
@contextfree 10 күн бұрын
No promises, but maybe sometime. I tend to bounce around some.
@joshring8563
@joshring8563 10 күн бұрын
What did you think of using C3 for this project?
@contextfree
@contextfree 10 күн бұрын
It's a great language for C interop, and after digging and help, it had everything I needed for this project. Struct of arrays would have been handy here also, and it sounds like Christoffer Lernö might be willing to add that to the language in the future. I can't promise that outcome. In any case, I think it's a great language for certain people and use cases.
@spyro3635
@spyro3635 10 күн бұрын
Thought it was a new tsoding video with the c3 and wasm lol
@contextfree
@contextfree 10 күн бұрын
I did watch some of one of his streams. Though I already had this underway before that. Just another coincidence that life seems to be full of.
@bean_TM
@bean_TM 10 күн бұрын
Same lmao. Was confused for a sec
@jupiterssixthmoon3402
@jupiterssixthmoon3402 11 күн бұрын
I would be curious to see the stats on how they performed differently. A simple elapsed time print for each on your most demanding part of the code. var start_time = Time.get_ticks_usec() var end_time = Time.get_ticks_usec() var elapsed_time = end_time - start_time print(elapsed_time)
@BadQuanta
@BadQuanta 12 күн бұрын
Thanks for this interview. I appreciated Turbo Pascal deeply. This has peaked my interest in TypeScript. I have been using CoffeeScript but I think it could use better tooling too.
@verdynn5917
@verdynn5917 Ай бұрын
Demonstrating python classes using slots would be a good alternative to dataclasses and the like
@realisticlevel2553
@realisticlevel2553 Ай бұрын
bad part is yt disabled my bell notifications :( good part is I have tons of context free content to watch :)
@stevenhe3462
@stevenhe3462 Ай бұрын
Why LZ4 instead of ZStd?
@contextfree
@contextfree Ай бұрын
Mostly because I didn't find it when I went looking for options. Thanks for the tip! But I may have chosen lz4 anyway. Looks like zstd compresses more but decompresses slower than lz4. Might not matter if the read speed is slow enough anyway. But also seems like lz4 has more implementations out there. I should keep zstd in mind anyway for reconsideration at some point. Thanks again for the tip!
@Caellyan
@Caellyan Ай бұрын
It would be cool to see a company like Framework (not them; they have their own niche) release a physical console that actually runs a FOSS console runtime and loads WASM games from SD cards. That would be super nice to develop for.
@marcsfeh
@marcsfeh Ай бұрын
why use wasm then? just use arm or riscv. or even jvm byecode, wasm is such a bad bytecode format
@Caellyan
@Caellyan Ай бұрын
Wasm has good native runtimes on most platforms, so it's least friction. It would be easy to write and test modules with it. It would also make it safe to run 3rd party games without worrying about security.
@contextfree
@contextfree Ай бұрын
From what I hear, the biggest complaint about wasm is the lack of goto, but people work around that. I suspect wasm64 would also make some people happier. But overall, yeah, I think wasm and the widespread support for it are great.
@contextfree
@contextfree Ай бұрын
Also, why use SD cards rather than just downloading games? I think there might be pros and cons, and I'm curious to hear your thoughts. Thanks!
@4115steve
@4115steve Ай бұрын
very interesting video, thanks for sharing
@UliTroyo
@UliTroyo Ай бұрын
There's always that point in discussions of GPU stuff where I feel myself come up against a brick wall. Graphics is what I want to wind up doing, but man, I'm still not there and it's so frustrating 😬
@contextfree
@contextfree Ай бұрын
I'm still just scratching the ice really. Just trying to understand the apis enough that I make something good enough and easy enough to use. Now how would I build a quality renderer on top of this is way past my level. I can do some basic things but only the basics.
@Germisstucklmao
@Germisstucklmao Ай бұрын
Interesting. Have you considered using ANGLE and opengl es? That's what I'm using, but I am also using an abstraction library called rlgl
@contextfree
@contextfree Ай бұрын
ANGLE is potentially lighter weight than wgpu, but I'm doing ok at the moment, and I might transition the web implementation to webgpu someday in the future, which would make the two implementations align closer. But yeah, I agree that angle is tempting.
@contextfree
@contextfree Ай бұрын
And yeah, raylib rocks. Maybe someone could implement taca on raylib someday if I make enough progress on taca in the first place.
@Germisstucklmao
@Germisstucklmao 26 күн бұрын
Just out of curiosity, why did you choose webgpu out of all the options?
@contextfree
@contextfree 26 күн бұрын
@@Germisstucklmao It provides good flexibility, and wpgu is under active development, although maybe semi stabilizing now, too, which can be a good combo. And I'm definitely learning some differences by actively working in both wgpu and webgl at the same time.
@Germisstucklmao
@Germisstucklmao 11 күн бұрын
Hey, how did you manage to (presumably) make a custom wasmer runner? I can't seem to find any information about it
@theevilcottonball
@theevilcottonball Ай бұрын
Have you looked at andre weissfloh's sokol. It also cross compiles shaders, supports cross-platform native and web, etc. It supports C, C++, ODIN, Zig,...
@contextfree
@contextfree Ай бұрын
I've looked at sokol some before but haven't used it much. I didn't remember it did shaders, so thanks! Looks like it uses spirv cross for spirv support, which seemed likely heavier weight than naga, but maybe I should give it a closer look.
@glebbash
@glebbash Ай бұрын
pog
@platin2148
@platin2148 Ай бұрын
Rust Simply blows up as soon as you do Handles as this isn't considered being a pointer. Or doing arbitrary memory access by the user like: use std::env; fn main() { let args: Vec<String> = env::args().collect(); let arr = [1, 2, 3, 4, 5]; let number : usize = args[1].parse().expect("Not a valid number"); println!("{}", arr[number]); } Yes you should sanitize your input but in this case it's only runtime detectable and not really anymore safe except that it does a direct abort well in C++/C with a simple array you'd also get that. But it's optional as such you don't trade performance for the bounds checking. It's actually quite expensive and as far as i know only "unsafe" can make it better but even that i heard isn't true in some cases. Well and there is a lot of code that is written like this to avoid the penality. Well not to say C++ is a good option here but there are plenty of things you simply don't capture at comp time.
@SpelMalmer
@SpelMalmer Ай бұрын
The Odin killer feature is the array math operations and swizzling that also compiles into simd when applicable. Does jai have anything like it?
@eptic-c
@eptic-c Ай бұрын
c# might be 55 MB but rust is almost 75MB xD
@contextfree
@contextfree Ай бұрын
Turns out that was because of debug mode. It ended up being like 6MB in release mode. I just wasn't paying attention.
@eobet
@eobet Ай бұрын
I see you are using a PerlinNoise3D node. Does that not exist anymore in Godot 4.3?
@contextfree
@contextfree Ай бұрын
Dug around some. Try this docs page to set up a plugin for it. Claims to be up to date. docs.godotengine.org/en/stable/tutorials/plugins/editor/visual_shader_plugins.html
@rcelyte
@rcelyte 2 ай бұрын
4:31 Minor correction: DataView getters will *always* use big endian unless `true` is specified, regardless of host endianness.
@contextfree
@contextfree 2 ай бұрын
Thanks much for the correction!
@stevenhe3462
@stevenhe3462 2 ай бұрын
🌮🌮🌮  🦀
@lucatracanna6955
@lucatracanna6955 2 ай бұрын
Almost the same situation in C/C++: you either use Emscripten which does most of the job for you OR you do it manually with Clang (which doesn't port the standard library so if you want to use std::vector, std::map etc. you gotta write them yourself). It would be nice to see a video about that too.
@contextfree
@contextfree 2 ай бұрын
My understanding is that emscripten also wraps lots of different libraries. It seems to be a very large scope project.
@contextfree
@contextfree 2 ай бұрын
Also, plain old rust compiling to wasm gets std Vec and most things. It's just the interop part that's awkward without extra tooling, at least for what I've seen so far. So that's also a difference.
@rcelyte
@rcelyte 2 ай бұрын
wasi-sdk provides a mostly exhaustive implementation of the C and C++ standard libraries without Emscripten, and works in-browser if you don't depend on platform features like file I/O.
@codeman99-dev
@codeman99-dev 2 ай бұрын
Seems WASM is coming back into general conversation again. Feels like it has been quiet since the announcement of WASM garbage collection. Maybe I stopped paying attention?
@contextfree
@contextfree 2 ай бұрын
To me, that's still a new announcement. I guess I work on a slower time scale. I have looked at the gc spec a little, though.
@Germisstucklmao
@Germisstucklmao 2 ай бұрын
This is pretty interesting. How complex is webgpu?
@contextfree
@contextfree 2 ай бұрын
Webgpu requires lots of manual and fiddly effort. New Taca plans give less control for a much easier time. And my new js implementation is directly on webgl2. But I'm currently still working on getting wgpu working for the native version.
@Germisstucklmao
@Germisstucklmao 2 ай бұрын
Why not use webgpu for the web as well?
@contextfree
@contextfree 2 ай бұрын
It's only available in Chrome and not on Linux. Presumably someday though.
@BenjaminAster
@BenjaminAster 2 ай бұрын
Love this! btw, the WebAssembly JS API spec recently got a `.toResizableBuffer()` method for Wasm memories, but it's not yet implemented by any browser. This would solve the annoying DataView/TypedArray re-instantiation thing, so let's hope it becomes available in browsers & runtimes soon.
@contextfree
@contextfree 2 ай бұрын
By the way, Node does have fetch support these days, which I'd actually missed, but it's still missing "file:" fetch. As mentioned in the video, Bun and Deno do both work out of the box on the demo as presented, including automatic support for both ES modules & TypeScript.
@arjix8738
@arjix8738 2 ай бұрын
Huh, I doubt browsers allow fetching file: either. Node's fetch API is compliant with the browser's fetch API. Same specification and standard
@contextfree
@contextfree 2 ай бұрын
The code is written to be relative to the js module URL. Running from command line here means file. That's all.
@IndellableHatesHandles
@IndellableHatesHandles 2 ай бұрын
I thought I was good at programming until I watched this video
@aaaaaaaaaaaaaaaaaaaaaaaaaaaab1
@aaaaaaaaaaaaaaaaaaaaaaaaaaaab1 2 ай бұрын
off-topic - ginger bill becoming bald makes him appear more kind and authoritative
@henrikholst7490
@henrikholst7490 2 ай бұрын
V-lang have them both beaten for my kind of programming. The error handling has an explicit out-of-band handling that you cannot screw up.
@knofi7052
@knofi7052 2 ай бұрын
Delphi was your best work, Anders! Unfortunately, Microsoft destroyed it...😉
@Leao_da_Montanha
@Leao_da_Montanha 2 ай бұрын
nice format
@koopa-if5sr
@koopa-if5sr 3 ай бұрын
Liked the video, but the diffs added too much noise to clearly understand what the difference were. I guess it would've been better to highlight the diff while going through post-production.
@GQLewis
@GQLewis 3 ай бұрын
This is a very interesting conversation. Sorry I am late to the party.
@software_engineer_business_man
@software_engineer_business_man 3 ай бұрын
Yeah, Zig was much better than Rust here. And damn, Rust is very unreadable. It manages to be as bad as reading code in C++.
@RustIsWinning
@RustIsWinning Ай бұрын
My zigga your language is not even memory safe. Rust is winning.
@kgibbershnoxss
@kgibbershnoxss 3 ай бұрын
It’s fun seeing this project progress. Also, it would be funny if you optimized tail calls by emitting a “return_call” instruction
@contextfree
@contextfree 3 ай бұрын
I missed that that's standardized in wasm already. I'll have to see the support for that. And I'd want to have explicit tail call indicator of some sort in Rio for that, I think. And I'd eventually want to verify it in the Rio compiler if so. But yeah, I think tail calls are great when verifiable.
@contextfree
@contextfree 3 ай бұрын
And thanks for drawing my attention to it! And I'm not yet sure exactly how I'd want to indicate it in Rio syntax yet.
@slowpnir
@slowpnir 3 ай бұрын
I'm watching and thinking rn: thanks god and SPJ we have proper constrained overloading in haskell, and not _this_
@mikolmisol6258
@mikolmisol6258 3 ай бұрын
I love seeing the progress on Rio! I'm assuming it has structural typing, judging by the fact you can create anonymous records using the struct function?
@contextfree
@contextfree 3 ай бұрын
Thanks for the encouragement! I'm actually leaning toward nominal typing, and it's actually nominal right now. I should have mentioned that in the video. The = is a fixed definition, then I track it as a distinct thing. I love structural, but nominal is easier to code in the compiler and easier to report in messages (although I don't have messages yet). Maybe easy spread syntax will get some of the advantages of structural also. But I also need to see how it goes. Some people want design set in stone in advance, but I'm still winging it some.
@contextfree
@contextfree 3 ай бұрын
I do also plan separate "packed" (somewhat like Rust "Copy" trait) and "class" types from "struct", where packed and struct act like C# record types also in ways, but classes are opaque abstractions. And might still say "record" instead of "struct". Thinking about that.
@LarryGarfieldCrell
@LarryGarfieldCrell 3 ай бұрын
You've already done more to show how to work with Wasm than every other tutorial I've ever seen, because you showed how strings work. Every other tutorial stops at integers, which is kinda useless. So, thank you! One of these days I want to try building a Wasm language, but I really don't have the time for figuring out all the little details like that.
@contextfree
@contextfree 3 ай бұрын
Glad the videos are helpful to you! And yeah, life balance is tricky. Gotta make the decisions that are right for your situation, whatever those are.
@contextfree
@contextfree 3 ай бұрын
And I still need to study wit (wasm interface types) sometime.
@LarryGarfieldCrell
@LarryGarfieldCrell 3 ай бұрын
@@contextfree I'd love a video on those and how to use them! Really, any walk through of how you've done what you've done would be helpful.
@jmstevers
@jmstevers 3 ай бұрын
have you looked into algebraic effects? ive been researching them and just wanted to know what you think of the idea
@contextfree
@contextfree 3 ай бұрын
I've played with Koka some, but I still don't feel super familiar with them. For Rio, I plan to indicate in effects in some fashion, maybe even just by required args, but I probably won't go full algebraic effect handling or anything.
@JohnnySacc
@JohnnySacc 3 ай бұрын
Just looked it up and read a blog post on it. Is it not just dependency injection? I get that it goes up the stack to find the closest 'handler' for a certain effect, but similarly you can pass dependencies down.
@contextfree
@contextfree 3 ай бұрын
By "required args", I effectively meant dependency injection. Some languages make effect handling a primary language feature though, and maybe combined with coroutines and such, they get more low-level flow control out of it. But I can't speak authoritatively on the subject at all.
@contextfree
@contextfree 3 ай бұрын
I have some videos on effects and also dynamic scope where I explore the subjects in a limited way, but that's as far as I've gone.
@jonas1ara
@jonas1ara 3 ай бұрын
Why is call it rio?
@contextfree
@contextfree 3 ай бұрын
I've been calling my hobby language plans Rio for decades, even though the specific language plans have changed over time. It's had more meaning for some of those language variations than others (in the "river" sense of the word). But it's primarily named for my fond (and sometimes not so fond) memories of Río Blanco, San Marcos, Guatemala.
@contextfree
@contextfree 3 ай бұрын
Rio conveniently also might remind people of Lua, which is nice because I aim to be small in implementation and feels like Lua is. If the R reminds people of Ruby, that's also not so bad. Even though Rio is statically typed unlike default Lua or Ruby.
@contextfree
@contextfree 3 ай бұрын
And might remind people of Lua since that comes from a more famous place with Rio in its name.
@contextfree
@contextfree 3 ай бұрын
And sorry for the spam, but maybe only 10-15 years of using that name for projects and ideas.
@jonas1ara
@jonas1ara 3 ай бұрын
@@contextfree and Rio languages it will only be a hobby or plans that are something real?
@Tobiky
@Tobiky 3 ай бұрын
Man I love this channel so much. You have actually inspired me into taking college courses in the formal logic of programming languages (such as lambda calculus) and I have been absolutely loving it. Thank you!
@dunkyl
@dunkyl 3 ай бұрын
The structure arg running kinda reminds me of "the other side" of struct decomposition patterns in a function definition, like in JS or F#. Cool idea
@contextfree
@contextfree 3 ай бұрын
And I hope to have destructuring definitions and pattern in matching in Rio also. If I allow those in arg position for ad hoc arg struct types, it would look just like defining named args also, but I'm not yet sure if I want ad hoc structs like that. And I'm moving slow here, clearly, so we'll see what gets done. Thanks for the comment!
@JosephOziel
@JosephOziel 3 ай бұрын
I love where this is going!