6 Programming Languages in 1 Godot Game! Trying out GDExtension!

Sdílet
Vložit
  • čas přidán 6. 07. 2024
  • Code: github.com/contextfreecode/gdext
    0:00 Intro
    0:46 GDScript
    1:41 C# (csharp)
    4:15 C++ (cpp)
    8:18 Rust
    11:23 Swift
    14:19 Zig
    18:39 Outro
  • Věda a technologie

Komentáře • 100

  • @ElvisZhou
    @ElvisZhou Před 2 měsíci +20

    godot-zig's author here, it's great to see zig related stuff spread, really awesome job!
    FYI: the issue mentioned in the video has been fixed.

    • @contextfree
      @contextfree  Před 2 měsíci +2

      Thanks so much!

    • @SophiaWaggoner
      @SophiaWaggoner Před 2 měsíci +2

      I'm a Rustacean for sure but I've been recently going back to explore other languages to expand my horizons and I've discovered my favourite language for the more low-level stuff is definitely Zig. My main criticism is that its not quite there yet in terms of popularity and support and good bindings are scarce so it's really awesome to see stuff like this (both your bindings and the inclusion of it in this video) as it proves that Zig is growing and has a solid shot at becoming everything it's capable of.

  • @abmarnie9
    @abmarnie9 Před 3 měsíci +69

    I've heard that they are hoping to eventually move C# to GDExtension (maybe for 5.0) but also generally improve the experience of GDExtension languages to be as easy to use as C# currently.

    • @Volt-Eye.
      @Volt-Eye. Před 3 měsíci +9

      If that happens Am gonna write my whole game in assembly then 😂😂😂😂😂

    • @NeZversSounds
      @NeZversSounds Před 3 měsíci

      @@Volt-Eye. What's holding you back?

    • @Volt-Eye.
      @Volt-Eye. Před 3 měsíci +2

      @@NeZversSounds The need bro !
      Why code in assembly if am making a platformer. Its like to go 200mtrs you first preparing an F35 then burning gallons of gas to travel it.
      Just use feet or a scooter.
      Its just like this

    • @JustVoylin
      @JustVoylin Před 2 měsíci +4

      As someone writing daily in GDExtensions ... I hope this will happen as the current GDExtension workflow is everything except smooth sailing ^^"

  • @sanderbos4243
    @sanderbos4243 Před 3 měsíci +58

    Awesome! I am happy to see Zig being represented too

    • @sporefergieboy10
      @sporefergieboy10 Před 3 měsíci +9

      ziggers rise up

    • @RenderingUser
      @RenderingUser Před 3 měsíci +5

      ​@@sporefergieboy10nah, yall need a better name 💀

    • @ArcWeltraumpert
      @ArcWeltraumpert Před 3 měsíci

      me too 😂

    • @themathophage8238
      @themathophage8238 Před 3 měsíci +5

      The name's actually "ziguanas"

    • @steveoc64
      @steveoc64 Před 3 měsíci +1

      lol, people that use Zig are called “programmers” .. just like C programmers, etc. it’s not a religious cult, which is one of the great appeals.

  • @ariansun4879
    @ariansun4879 Před 3 měsíci +12

    Such a cute idea and nice project.
    I remember toying around with Nim and the OG GDNative a few years back and I really liked how GDScript and Nim shared some ergonomics, which made a shared code based a bit nicer to look at.
    Also really liking the Zig version, excited to see it mature a bit.

    • @contextfree
      @contextfree  Před 3 měsíci +2

      Nim is a lovely language. (And I'd be happy to take contributions to the repo, if you're up for it!)

  • @casperes0912
    @casperes0912 Před 3 měsíci +25

    Swift version looks pretty good

  • @GZXC993
    @GZXC993 Před 3 měsíci +10

    A cool idea and well presented. It really showcases the flexibility Godot and its community foster. Great work!

  • @vectoralphaSec
    @vectoralphaSec Před 3 měsíci +7

    Godot is awesome. Allowing devs to make video games in whatever language they want or know best is great.

  • @MyCodingDiarie
    @MyCodingDiarie Před 3 měsíci +4

    Your channel is like a hidden gem on CZcams. So glad I found it!

  • @sean_r
    @sean_r Před 3 měsíci +7

    Always great to see Zig get some usage

  • @UliTroyo
    @UliTroyo Před 3 měsíci +9

    I recently saw a devlog for a game being made in Odin that was pretty good. I like the abundance of languages!

  • @dranon0o
    @dranon0o Před 3 měsíci +5

    Very nice, super cool to have put Zig in it
    I would have been curious about the size of the builds for each languages, just to know if it change something and if there is a need to have dll or if godot can be embed, pretty sure a zig build could make godot part of the binary build

  • @MyCodingDiarie
    @MyCodingDiarie Před 3 měsíci +1

    I've never commented on a video before, but I had to for this one. It's that good!

  • @TeamPuzel
    @TeamPuzel Před 3 měsíci +5

    Yeah, Swift can't yet easily cross compile. There is however an experimental "embedded" mode that removes the libc and unicode dependencies, and aside from String and existential support still being work in progress it's actually really usable (you can now build for freestanding wasm for example). I don't know if or when SwiftGodot will support that though.

  • @moofree
    @moofree Před 3 měsíci +4

    I always knew this kind of thing was possible with Godot, but seeing it in action is amazing.

  • @leonss2356
    @leonss2356 Před 3 měsíci +8

    hell yeah zig

  • @lucy-pero
    @lucy-pero Před 3 měsíci +5

    Very cool idea for a video. I'm making games in Godot currently and this is very interesting. Thank you!

  • @shableep
    @shableep Před 3 měsíci +4

    honestly really hoping for a strong non-Apple ecosystem for Swift. it’s such a beautifully language. intuitive and ergonomic enough to be approachable by beginners, and at the same time with comparable performance to C++ for experts.

  • @Kitsune_Dev
    @Kitsune_Dev Před 2 měsíci +2

    can you also showcase Lua? I’m from Roblox and would love to try out Godot

  • @ThomazMartinez
    @ThomazMartinez Před 3 měsíci +3

    Which language did you find most enjoying to work with?

  • @mjKlaim
    @mjKlaim Před 3 měsíci +6

    For the C++ case and package managers: I current lhave a game project using build2 (as build-system + package manager) and Godot+GDExtension, I made a build2 package of the godot-cpp library you need to use for your GDEXtension (it's available to the community but is not deeply testeD). Once I setup that package it simplified a lot of things in the game project as it's now automatically doing all the necessary code generation and linking, probably similar to how it works with the other languages with package managers providing the same thing.
    I think in C++ to also have less of the binding declaration noise parts, we would need it to be generated through reflection. So maybe in 10 years XD
    Auto-reloading works well for me but I didnt try to expose signals yet so maybe you found some limitations.

    • @contextfree
      @contextfree  Před 3 měsíci +1

      Any handy links for that build2 setup by chance?

    • @contextfree
      @contextfree  Před 3 měsíci +1

      Maybe have to format links weird for CZcams to let you paste them, though.

    • @mjKlaim
      @mjKlaim Před 3 měsíci +2

      @@contextfree yeah my answer got erased, I'll ping you privately

    • @contextfree
      @contextfree  Před 3 měsíci +3

      Seeing if I can post your link here: github.com/build2-packaging/godot-cpp

    • @oriyadid
      @oriyadid Před 2 měsíci +1

      ​@@contextfreeThanks!

  • @rafae5902
    @rafae5902 Před 2 měsíci +1

    Very interesting.
    I wonder about how well Zig will perform when being used inside GDExtension.
    Do you believe that the way Zig allocates memory could be a problem?

  • @Kapendev
    @Kapendev Před 3 měsíci +5

    Haxe and DLang seem interesting.

  • @jonas1ara
    @jonas1ara Před 3 měsíci +5

    Swift is sweet

  • @sirbuttonhd
    @sirbuttonhd Před 3 měsíci +1

    always hyped when you release a new video

  • @nightRobinO_O
    @nightRobinO_O Před 3 měsíci +3

    Godot is so versatile 😮
    Could you do Go, too?

    • @contextfree
      @contextfree  Před 3 měsíci +2

      I've got to move on to other things right now, but feel free to contribute to the repo!

  • @commentingexistentialcrisi9564
    @commentingexistentialcrisi9564 Před 3 měsíci +7

    Swift actually looks like a really good option, can anybody provide any more cons? Im actually considering using it for a big project

    • @KyleLuce
      @KyleLuce Před 2 měsíci +3

      Not certain on specific issues you will encounter, but recognize the inherent risk of taking the less treaded/vetted path.
      You'll probably have a lot less knowledge base, from the community to lean on and many times the lesser used language bindings aren't feature complete. I'd look through the issues on bindings repo to see if there are any show stoppers for your project.

  • @Tomsudobrej
    @Tomsudobrej Před 3 měsíci +1

    Hey, this is cool, I really wanted to see these differences. What's the thing you said about firing up Godot from (e.g.) C++ instead of going through the editor? I never read about this, can you explain a little please?

    • @contextfree
      @contextfree  Před 2 měsíci

      I thought I saw it discussed in godot-rust docs, but I may have misread that. Here's some discussion about it for SwiftGodot, though, and maybe their same methods can apply elsewhere, although it might take some coding work. github.com/migueldeicaza/SwiftGodot?tab=readme-ov-file#driving-godot-from-swift

    • @contextfree
      @contextfree  Před 2 měsíci

      Core support code seems to be here. github.com/migueldeicaza/SwiftGodotKit/blob/main/Sources/SwiftGodotKit/SwiftGodotKit.swift

    • @contextfree
      @contextfree  Před 2 měsíci

      I may have seen this in godot-rust and imagined/misremembered more, but if there are cli options to start up the game immediately rather than enter the editor, that might be good enough for main dev purposes. godot-rust.github.io/book/intro/hello-world.html#admonition-tip-1

    • @Tomsudobrej
      @Tomsudobrej Před 2 měsíci +1

      @@contextfree Thanks man for your responses :D This is very interesting!

  • @remcogreve7982
    @remcogreve7982 Před 3 měsíci +5

    To be honest I really like swift. Too bad it is not really used outside the apple ecosystem.

  • @FightClass3
    @FightClass3 Před 3 měsíci +3

    Swift ❤

  • @noctemcat_
    @noctemcat_ Před 2 měsíci +3

    3:51 tbh, in C# you don't need to use signals. You can just use C# events, the workflow should be similar, and they should be faster as long as you just use C# with the only minus being that you wouldn't be able to see and connect them in the editor

    • @contextfree
      @contextfree  Před 2 měsíci +1

      Can GDScript still connect to them in code?

    • @noctemcat_
      @noctemcat_ Před 2 měsíci

      @@contextfree Nope, because of this I specified "as long as you just use C#" and just connect to signals in code. The last time I looked at it, you could call C# methods from GDScript and vice versa(page "Cross-language scripting" in the docs), so it should be possible to cludge something that will store connected node and call its method on event. But at this point you are paying way too much for it and should just use Signals.
      I don't have too much experience with it, but mixing different languages together was very clumsy the last time I tried it

    • @contextfree
      @contextfree  Před 2 měsíci +1

      Thanks much for the extra info! In this case, I'm definitely communicating across languages, so signals are important here. I'm also calling a C# method from GDScript. But thanks for adding the context that this doesn't apply to people using only C#.

  • @dugtrioramen
    @dugtrioramen Před měsícem +1

    Apparently there's a web assembly gd extension now. So every wasm language is now fair game too 😂

  • @romankoshchei
    @romankoshchei Před 3 měsíci +2

    What linux are you using?

    • @contextfree
      @contextfree  Před 3 měsíci +2

      Pop, but I'm not totally in love with it. It's ok.

  • @sayaks12
    @sayaks12 Před 3 měsíci +2

    some of that rust code is a bit weird, like
    let position = match () {
    _ if .. => ..
    _ => ..
    };
    is just a more complicated way of writing
    let position = if .. {
    ..
    } else {
    ..
    };
    clippy would probably pick up on that if i were to guess

    • @contextfree
      @contextfree  Před 3 měsíci +1

      I'm weird and find if/else bothersome, but understood that my style is unusual.

    • @omg33ky
      @omg33ky Před 2 měsíci +3

      ​@@contextfree it is quite unusual but if you like it go for it.
      One more way you could write it is:
      let position = match self.state == State::Wait {
      true => self.start,
      false => position,
      };
      This might be a bit more readable for other people and still avoid the else if you don't like it.
      (Note: I wrote this code from memory so it might have some small syntax errors)

    • @BrunodeSouzaLino
      @BrunodeSouzaLino Před 2 měsíci

      Rust favors pattern matching instead of if statements for most things.

    • @sayaks12
      @sayaks12 Před 2 měsíci

      @@BrunodeSouzaLino not in cases like this. rust has if expressions because they're more appropriate sometimes. and matching on () just to use an if guard to distinguish between two cases is absolutely a situation where an if expression is more appropriate

    • @contextfree
      @contextfree  Před 2 měsíci

      @@sayaks12 To state my usage differently, I find match structure much clearer. I suspect many languages mostly support traditional if/else because it's traditional and people are used to it. Familiarity of course does matter in usability, though.

  • @Volt-Eye.
    @Volt-Eye. Před 3 měsíci +3

    Should we bring Swift for Godot than C# ?

    • @BrunodeSouzaLino
      @BrunodeSouzaLino Před 2 měsíci

      Not really. Swift is very hard to use outside the Apple ecosystem.

  • @verbnoun1531
    @verbnoun1531 Před 3 měsíci +3

    13:30 Interesting that the Rust lib was over 100x the size of the C++ lib.

    • @contextfree
      @contextfree  Před 3 měsíci +3

      Funny, I didn't even look at that. Thanks for noticing! I just made a release mode build and checked the size, and it's about 6 MB. Glad release mode makes a big difference there.

  • @obkf-too
    @obkf-too Před 3 měsíci +1

    Odin lang soon!?

    • @contextfree
      @contextfree  Před 3 měsíci +1

      I have to move on to other things but Odin would be awesome. Feel free to contribute to the repo!

  • @ArcWeltraumpert
    @ArcWeltraumpert Před 3 měsíci

    wait, zig, it's interesting, i thought you will develop an os using zig 😂😂😂

  • @gertrudessampaio8689
    @gertrudessampaio8689 Před 3 měsíci +1

    Rust 😊😊

  • @Lycam
    @Lycam Před 2 měsíci

    It does a half ass job full of bugs with c#, why they keeo waste resources with anything else

  • @K4rmy
    @K4rmy Před 3 měsíci +1

    That C# logo is old

    • @contextfree
      @contextfree  Před 3 měsíci

      There's no official C# logo, last I went looking. This one is actually still referenced secretly on some MS pages, though, at least in the past year or two. There's also the unofficial logo that's designed to look like the C++ logo, but I'm not sure where it comes from.

    • @K4rmy
      @K4rmy Před 3 měsíci +1

      ​@@contextfreeI have posted few answers already, but for some reason they disappear.
      Anyway, lookup C# on Wikipedia and you'll find the actuall current logo, if you click on it you'll find their source's location.

    • @contextfree
      @contextfree  Před měsícem

      Wikipedia sometimes has unofficial logos, but I dug into the sources now, and even if this one still doesn't quite seem "official", you're right that is newer and Microsoft is using it at least sometimes in official places, so I used it for my latest video. Thanks much for the tip on that!

  • @WaliaIbex
    @WaliaIbex Před 3 měsíci

    Why craps like swift , c# and not js

    • @inkryption3386
      @inkryption3386 Před 2 měsíci +6

      why would you use JS for this? it's slow and designed primarily for writing scripts for websites.

    • @WaliaIbex
      @WaliaIbex Před 2 měsíci

      @@inkryption3386 If js is Good for Unity it is good enough for GODOT. These days js is not only for web it is everywhere .

    • @rafae5902
      @rafae5902 Před 2 měsíci

      what a joke LOL

  • @sumofat4994
    @sumofat4994 Před 3 měsíci +1

    Did you intentionally picked the worst languages for game dev on purpose?

    • @inkryption3386
      @inkryption3386 Před 2 měsíci +9

      how are these the worst languages?

    • @BrunodeSouzaLino
      @BrunodeSouzaLino Před 2 měsíci

      Almost everything is C++ these days so you probably didn't watch the video.

    • @inkryption3386
      @inkryption3386 Před 2 měsíci

      @@BrunodeSouzaLino I wouldn't say most things are in C++, most people are writing in JavaScript frameworks, probably followed by python and maybe Go, C++ is mainly legacy and specialized use cases like Unreal that basically define a DSL.

  • @adicide9070
    @adicide9070 Před 3 měsíci

    it's whack how these languages look like one another. shit has become so homogenized.

    • @contextfree
      @contextfree  Před 3 měsíci +3

      What kinds of things would you find interesting?

    • @adicide9070
      @adicide9070 Před 3 měsíci +1

      I always watch youe stuff and think it's mighty interesting! I've probably been learning too much ocaml recently and now everything brace-delimited looks samey :) semantic differences notwithstanding, that is. I like your own language for videos, to be honest @@contextfree

    • @contextfree
      @contextfree  Před 3 měsíci +2

      Thanks for the thoughts and the encouragement! And I still need to spend some time in OCaml 5.

    • @adicide9070
      @adicide9070 Před 3 měsíci +1

      ah that's right. I forgot but you did say you would in your language overview for... 2023 it was? multicore and effect handlers ;)@@contextfree