Will Ada Replace C/C++?

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ค. 2024
  • Links:
    - Download the Game: tsoding.itch.io/eepers
    - Source Code of the Game: github.com/tsoding/eepers
    - Twitch: / tsoding
    - The NSA joke tweet: / 1764595562291024333
    - The NSA list of memory-safe programming languages: readwrite.com/the-nsa-list-of...
    - Type 42 (Author of the Soundtrack): / type42
    - Raylib: www.raylib.com/
    - Old Ada Mode for Emacs: github.com/tkurtbond/old-ada-...
    - Learn Ada: learn.adacore.com/
    Chapters:
    - 0:00:00 - Intro
    - 0:01:44 - Eepers
    - 0:04:45 - Hello World
    - 0:09:41 - "Advanced" Build Systems
    - 0:10:51 - Text Editors
    - 0:12:29 - Raylib
    - 0:16:15 - Biggest Secret in Tech
    - 0:18:37 - Interfacing with C
    - 0:25:02 - Library Bindings
    - 0:27:16 - Windows
    - 0:30:14 - Documentation
    - 0:32:59 - Best Feature of Ada
    - 0:43:02 - Conclusion
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 442

  • @SimGunther
    @SimGunther 28 วันที่ผ่านมา +327

    Took me a bit to notice this was not the Tsoding Daily channel. Welcome once again, 3rd owner of the channel 😊

    • @jamesnewman9547
      @jamesnewman9547 27 วันที่ผ่านมา +14

      Wow. I was subbed to daily and not this channel 😂
      Love your content tsoding.

    • @lolidkstudio
      @lolidkstudio 24 วันที่ผ่านมา +2

      3rd owner? Sorry im new here this channel was just recommended to me

    • @obsessedcultist3012
      @obsessedcultist3012 24 วันที่ผ่านมา

      I didn't notice until the very end

  • @im_gin
    @im_gin 27 วันที่ผ่านมา +125

    the (third) owner of main Tsoding channel finally remembered his password

    • @lolcat69
      @lolcat69 27 วันที่ผ่านมา +2

      Why third owner?

    • @cobbcoding
      @cobbcoding 26 วันที่ผ่านมา +16

      @@lolcat69 have you seen the other two guys who run this channel?

    • @MohammedShuayb
      @MohammedShuayb 25 วันที่ผ่านมา +1

      ​@@cobbcoding Wow i also follow you and you watch this guy😂

    • @judahwilson6756
      @judahwilson6756 23 วันที่ผ่านมา

      Lol

  • @000dr0g
    @000dr0g 27 วันที่ผ่านมา +60

    I "studied" Ada as an Edinburgh University CS student in the early 80s, with access only to a book about it, rather than a working compiler. I love how you've renewed my interest in Ada with your exciting explanation of its type safe indexes. I don't remember that powerful feature, nor can I think of a similar thing cropping up in subsequent language designs elsewhere. Great job.

    • @daruyami
      @daruyami 27 วันที่ผ่านมา +5

      "[...] rather than a working compiler." I've read that in the history of Ada there was a time at the beginning where compiler developers advertised their support for Ada which in reality was extremely lacking and buggy ...is that what you refer to here? 😅

    • @000dr0g
      @000dr0g 27 วันที่ผ่านมา +11

      @@daruyami back when I was at Uni, Ada was the US DoD military standard MIL-STD-1815, and my lecturer recommended a recent published book on it to read (which I probably have in my attic). If you wanted a compiler, you wrote your own from that stuff.

    • @daruyami
      @daruyami 27 วันที่ผ่านมา +2

      @@000dr0g thanks for the response, I always love hearing about how differently people had to approach things like these back in the day! I guess all that stuff about the compilers must've come from the perspective of somebody that experienced the commercial side of Ada around that timeframe or maybe it was just another speck of misinformation from the internet lol. Anyways, did you end up working with Ada after that, or did you just study it for some time? Did it sound like anything amazing or innovative when compared to other technologies used at that time?

    • @000dr0g
      @000dr0g 27 วันที่ผ่านมา +7

      @@daruyami The Edinburgh CS course had a 3rd year module which examined the interesting features of Ada, which represented a step forward in thinking from the systems programming languages being used at the time. In particular, I remember we looked at the definition of its module/packages system and its concurrency model (tasks and rendezvous). Since swotting for the end of year exam on it, I've forgotten the details, and never looked at Ada since. This is why I am happy to see that these days I can easily try it out for real, and was happily surprised by Tsoding highlighting the Range feature, which I definitely did not remember.

    • @user-mj6vt1oy5r
      @user-mj6vt1oy5r 26 วันที่ผ่านมา

      @@000dr0g I was at the Army Comp Sci school late '91 to spring '92. I was studying System Administration, but my buddies were taking the programming track. They were expecting "C", but got Ada. Oh My God. These were already senior programmers that were going through a pud course to have the official job in the Army. The entire time I was at Ft. Gordon, all I heard was screaming, bitching, and gnashing of teeth about Ada. They barely had a compiler, and the first class spent their entire course building basic modules for the library. I'm talking basic routines to talk to a video display ( It was designed so the primary output was a line printer). Compared to Ada, Python is a gift from the programming gods. Hell, even Java is better. I heard that the school got rid of it after a while and went back to "C". They wrote off Ada as a big waste of time for everyone involved. It may have been a good language, "in theory", but was total trash when they tried to use it in anger.

  • @joemamium
    @joemamium 28 วันที่ผ่านมา +58

    Tsoding 2: Here We Цод Again

  • @gkelly
    @gkelly 28 วันที่ผ่านมา +100

    He's back! Glad to see you uploading again. The Rust contingent must be furious to have their golden child appear in a list with Ada and Go. 😅

    • @angelcaru
      @angelcaru 28 วันที่ผ่านมา +16

      And Ruby

    • @friorento4416
      @friorento4416 27 วันที่ผ่านมา

      ​​@@angelcaruAnd python

    • @driedurchin
      @driedurchin 26 วันที่ผ่านมา +3

      Why?

    • @pookiepats
      @pookiepats 24 วันที่ผ่านมา

      @@driedurchinask chatGPT

    • @BrianMcKee
      @BrianMcKee 24 วันที่ผ่านมา

      And Pascal.

  • @KushLemon
    @KushLemon 27 วันที่ผ่านมา +22

    Short answer - no. Long answer - no.

    • @russianbotfarm3036
      @russianbotfarm3036 25 วันที่ผ่านมา +3

      Was a click-bait title, truthfully.

    • @therealpeter2267
      @therealpeter2267 17 วันที่ผ่านมา

      All I needed was a glimpse of the language, and that says much considering we are talking about c++ in the same context

  • @ExCyberino
    @ExCyberino 27 วันที่ผ่านมา +31

    Wait a minute, THIS IS the OG channel. That's @everyone was pinged instead of the @Pinged. Damn congrats bro

  • @notreallyme425
    @notreallyme425 27 วันที่ผ่านมา +45

    Learned C++ in school, then took a class in Ada. I noticed I could write a project in a couple hours in C++ and then spend the next 3 days debugging. But with Ada it would take me 2 days to write the code, and about 15 minutes to debug. Took me awhile, but I learned to love it!

    • @friedrichmyers
      @friedrichmyers 24 วันที่ผ่านมา +3

      Well, that depends on the complexity of the task too... If you had to make an operating system, would Ada or Rust really be good alternatives to C/C++? I don't think so.

    • @dalestanbrough2290
      @dalestanbrough2290 24 วันที่ผ่านมา +1

      @@friedrichmyers Why would C be better? What features does it have that you would need that Ada wouldn't have?

    • @friedrichmyers
      @friedrichmyers 24 วันที่ผ่านมา +7

      @@dalestanbrough2290 Too much handholding on memory. Too much complexity compared to C (When you C, you C the Assembly).

    • @dmitrykargin4060
      @dmitrykargin4060 24 วันที่ผ่านมา +6

      @@friedrichmyers”when you C, you C the assembly” is nice

    • @user-uf4rx5ih3v
      @user-uf4rx5ih3v 23 วันที่ผ่านมา +3

      @@friedrichmyers People have already created an OS in Rust, the language is also in the Linux kernel. Personally, I find it rather annoying to write in Rust, but would much prefer it over C++ any day. I think lumping C and C++ together is also rather strange. They are not even that similar honestly.

  • @nulligor
    @nulligor 28 วันที่ผ่านมา +57

    Ruby mentioned btw

  • @kleoCodes
    @kleoCodes 28 วันที่ผ่านมา +31

    The channel is back baby!

    • @musdevfrog
      @musdevfrog 27 วันที่ผ่านมา +2

      but your father don't.

    • @kleoCodes
      @kleoCodes 25 วันที่ผ่านมา

      @@musdevfrog bro what?

  • @valigo
    @valigo 28 วันที่ผ่านมา +9

    We are so back! Also sickest thumbnail art!

  • @ndrechtseiter
    @ndrechtseiter 27 วันที่ผ่านมา +45

    ЦОДИНГ ЗАПОСТИЛ
    ДЕНЬ ВОССТАНОВЛЕН

  • @LukeAGuest
    @LukeAGuest 27 วันที่ผ่านมา +13

    The ALI file contains the dependencies so that the linker can generate the correct linking information, also the binder uses it to generate code that needs to run to initialise things in your code, as you found out in Ada you can initialise data even with executable code. ALI's are gnat specific. Original Ada compilers were more like LISP systems with a program database, which was specified by the standard.
    When initialising data, you don't have to put the items in order when using names, you can do ```Y => 0.0, X => 1.0```.
    GCC's binding generator isn't great, you have to do a lot of work to fix what it generates.
    The ' allows you to access the attributes of the object in the language, whether that's a type, a variable/constant, package, task, etc. Everything is an object (not in the OOP sense), and every object has a set of attributes (language defined ones are listed in the reference manual and implementation defined ones are in the compiler's reference manual), so you can get a types first and last values or the length of a string that way. Ada had object derivation (not in the OOP sense) from the first version, look at the example of deriving an unpacked record from a package one in the Ada 83 rationale.
    What you can do with Ada when binding to C is to provide bounds to types, thus giving your binding a type safe veneer over the C API, this I what I did with SDLAda, but I will say that bitfields are more difficult to bounds check. Also, binding burnout is a real thing, so beware when doing it by hand.

  • @fishsayhelo9872
    @fishsayhelo9872 27 วันที่ผ่านมา +16

    took a good 10 minutes to notice this wasn't just an extra-fancy tsoding daily video :p

  • @jeezusjr
    @jeezusjr 27 วันที่ผ่านมา +3

    I first found you by searching for ada a few years back. Now I find a new channel. Nice work, and thank you for sharing!

  • @MoolsDogTwoOfficial
    @MoolsDogTwoOfficial 27 วันที่ผ่านมา +1

    I hope you upload more frequently on this channel. I love listening to you explaining things when it comes to programming.

  • @GrazHero
    @GrazHero 27 วันที่ผ่านมา +17

    When the world needed him most, he returned

  • @m4rt_
    @m4rt_ 27 วันที่ผ่านมา +1

    I did not expect to see a new upload on this channel in my lifetime, yet here I am.
    I'm exited to see where this continues.

  • @jkharabet
    @jkharabet 27 วันที่ผ่านมา +44

    The code written in C and C++ is probably well-established, which means we can rely on it despite the fact it was written in memory-unsafe languages. On the other hand, the new code that we write is worth writing in memory-safe languages even though we link it with c/c++ code.

    • @beauteetmusculation8191
      @beauteetmusculation8191 27 วันที่ผ่านมา +8

      It is somewhat true, to some extent. I think you don't really get reliable code when reaching for a C lib, but you'll get the same errors as everybody else. 😄

    • @absalomdraconis
      @absalomdraconis 26 วันที่ผ่านมา

      ​@@beauteetmusculation8191: Your code will be as reliable as the wrappers that you write.
      That is the problem.

    • @ScipiPurr
      @ScipiPurr 25 วันที่ผ่านมา +5

      @@beauteetmusculation8191 I think even if linking to a C/C++ lib isn't inherently safe, you can at least constrain much of the risk to just those libraries. I also think that even with so much code being written in C/C++, it doesn't mean many of those codebases can't be migrated to other languages over time

    • @araarathisyomama787
      @araarathisyomama787 25 วันที่ผ่านมา +5

      @@ScipiPurr With thread/memory/address/leak/undefinedbehavior sanitizers we have now, you can extensively test your usage and internals of those libraries (if you can compile them from source) yourself, and get most of the benefits of being "memory safe" and more (deadlock possibility detection in tsan is goty), just in runtime, and obviously, in your extensive test suite you should already have.

    • @monad_tcp
      @monad_tcp 24 วันที่ผ่านมา +1

      C++ is almost as memory-safe as Rust if there was an option to disable some features. The way move semantics work is almost like ownership.
      Also, Rust doesn't preclude undefined behaviors either, so its not totally memory safe and you can indeed leak memory in some cases, you can break it without even invoking "unsafe".
      Particularly I think garbage collectors are a better solution to the problem of managing memory at scale, the fact that the hardware doesn't have optimizations for garbage collectors is the problem.
      We really need some kind of pointer tagging system, either to solve the spectre problems with leaking on hardware and to make GC faster and more predictable.
      Memory allocation speed should have never been a problem as programs shouldn't be allocating memory at steady state, if you don't do something, it doesn't matter how costly it is do it. Everything should always go on stack, so the fact that you can have "arenas" to speed up GC is enough.
      The real problem is that programmers rely on algorithms that uses too much pointers, like trees, those are kind of slow, we should use arrays, like John Backus intended Fortran to be, no suck shenanigans as "pointers" or dynamic memory.

  • @joseph-montanez
    @joseph-montanez 27 วันที่ผ่านมา +12

    This is the language I always bring up when someone asks me about my favorite, this is it. Built-in language level concurrency, really good type system, pre and post contracts (runtime), Ada Spark, and now Alire for package manager. However... AdaCore supports GNAT (built tools) and doesn't provide bug fixes for the community edition, until the next major release. There is also really only x86 support, meaning on Apple Silicon it will compile to x86 on Mac. It can cross compile to ARM/RISC, but not for ARM on macOS. There is a way to get native AARCH64 builds for macOS, but its a rabbit hole. Editor support is also... lacking. The go to editor is GNAT Studio is Linux/Windows only, (there is a community build for macOS - iffy). SooOoOo, don't expect hand holding when working in this language. I really wanted to use this for embedded programming as this is where it shines but I end up getting lazy and instead reach for Rust.

  • @beauteetmusculation8191
    @beauteetmusculation8191 27 วันที่ผ่านมา +1

    Thanks a lot for this video. It's great to see you again on this channel. I just discovered a bit of Ada thanks to you, and I agree with almost all your takes.
    Simplicity is the most complicated goal in programming and computer engineering in general, but by far the most rewarding.

  • @actualFix
    @actualFix 27 วันที่ผ่านมา +22

    Ada seems like a language that has developed healthily, it seems like a language I can see myself using. It's simple, and aside from a few personal preferences, it's quite to my liking. And it's interesting to finally see the origin influence behind Odin's enumerated arrays(it works exactly the same), which is one of it's best features.
    Overall seems like a great language, and I'd love to see a wider adoption of it, over *a lot* of other languages currently in use. I'll definitely give it a shot.
    Thank you for this video, Zozin!

    • @joshuadonahue5871
      @joshuadonahue5871 26 วันที่ผ่านมา +2

      I think they were both influenced by pascal on enumerated arrays, but I'm not sure

    • @absalomdraconis
      @absalomdraconis 26 วันที่ผ่านมา +1

      ​@@joshuadonahue5871: Pascal (with Oberon in between, and maybe something I'm forgetting?) is a known influence on Ada (and I think shares a language designer).

    • @russianbotfarm3036
      @russianbotfarm3036 25 วันที่ผ่านมา +1

      @@absalomdraconis Modula 2, maybe.

    • @konstantinrebrov675
      @konstantinrebrov675 23 วันที่ผ่านมา

      Yes, you are right.

  • @forayer
    @forayer 27 วันที่ผ่านมา +9

    Really enjoyed the video 😊

  • @tubeincompetence
    @tubeincompetence 27 วันที่ผ่านมา +2

    Really great video. Educational, having code large enough to actually be properly visible, not repeating yourself so that it feels focused. Very enjoyable.

  • @daruyami
    @daruyami 27 วันที่ผ่านมา +7

    That's a really good introductory video on Ada, the only thing that I wish you had mentioned would be Alire, it's quite a fresh piece of the whole toolchain, however it's becoming a vital one. Anyways, nice work!

  • @motbus3
    @motbus3 27 วันที่ผ่านมา +4

    Sometimes I feel I am tired of software. I think I will just give up or something, then I watch Tsoding and I remember why I always loved programming.
    You are a legend. I watch your videos since back Haskell times.
    I don't have the time for the twitch stuff but I wish I did. Keep being awesome, and thank you. ❤
    Ps. Another video about Ada would be quite cool.

  • @PaulSpades
    @PaulSpades 24 วันที่ผ่านมา +2

    Your description of array, range and indices in Ada provided more insight and food for thought than I was expecting from this video. Well done!

    • @konstantinrebrov675
      @konstantinrebrov675 23 วันที่ผ่านมา +2

      These features are very interesting.

  • @doce3609
    @doce3609 27 วันที่ผ่านมา +4

    Amazing video. Loved it. Gotta try out Ada at some point. Actually looks very unique and interesting

    • @KushLemon
      @KushLemon 27 วันที่ผ่านมา +1

      Till you actually want to do something with it - the language and its ecosystem are a mess.

  • @KydEv
    @KydEv 27 วันที่ผ่านมา +10

    34:25 The 'Image is because you are not printing the array, you are printing the string representation of that array (so its appearance, in a way, its 'Image'). It is type safe, works with wide strings using Wide_Image... And it is very cool with enums and NULL stuff like that when printing

    • @user-uf4rx5ih3v
      @user-uf4rx5ih3v 23 วันที่ผ่านมา

      OK, why is it not a function? Why introduce new syntax, that's not even nice?

    • @KydEv
      @KydEv 23 วันที่ผ่านมา

      @@user-uf4rx5ih3v One big thing in Ada is clarity and definition about what is being done.
      Let’s say we don’t use ‘Image, but .To_String. We return a string with that function otherwise it is just Put_Line. Well, if I get a list of int as inputs. How do I know the size of the return value ? (Out). It may not depend ? What if there are side effects at the same time ?…

    • @KydEv
      @KydEv 23 วันที่ผ่านมา

      @@user-uf4rx5ih3v another way of saying it. Using Ada syntax, if Read_File was outputting the content of the file, then we would have to know the contents of that file before reading it to be able to write the return type at definition

  • @neilclay5835
    @neilclay5835 27 วันที่ผ่านมา +1

    Fascinating video. Thanks.

  • @boogly3716
    @boogly3716 27 วันที่ผ่านมา

    Wow, it's so goddam different from usual streams. Nice takes on the lang, a lot of interesting info

  • @cobbcoding
    @cobbcoding 26 วันที่ผ่านมา +2

    Tsoding is back let's go

  • @salim444
    @salim444 28 วันที่ผ่านมา +7

    mista zozing is cooking

  • @OCTAGRAM
    @OCTAGRAM 22 วันที่ผ่านมา +2

    Kudos for proper Ada maskot!
    I am Ada programmer on freelance. I've done some complicated project in Ada on freelance, and eventually I receive maintenance tasks on it. There were several projects, but two were maintained several years. One died because of sanctions.
    5:33 I have seen another Ada compilers. ObjectAda and AdaMagic. They can have file names module.spec.ada and module.body.ada. It's just GNAT beeing free and supporting latest Ada standard, defined de facto standards
    9:06 Turbo Pascal has TPU, Delphi has DCU, Free Pascal has PPU. GNAT makes use of GCC object formats, but then it has to offload the rich metainformation that just does not fit into object files. So ALI = DCU - OBJ = PPU - O. For instance, Ada has predictable initialization (called elaboration in Ada standard). On most platforms this facility cannot be fully put inside O files, so it's offloaded to ALI. ALI specifies dependencies between packages, and GNATBIND creates the "main program" that invokes initialization code for packages in a topological order, and then starts the Ada program itself. Also, GNAT allows some tweaks to be done from that "main program", so "main program" is also a storage for tweaks. For instance, leap seconds support can be force enabled via binder settings. Printing exception stack trace is another popular option.
    C++ has favoritism. So whatever C++ demands, usually comes into file formats and tools i.e. inline variables that require some sort of deduplication, are handled by ld. C++ binder is forced into ld. And C++ initialization/finalization without guaranteed order. Ada has no such favoritism. Dull people are deaf to our demands. Some particular Ada compilers may possibly go Delphi way and invent their own DCU with all the information they need, but GNAT's decision to use native Mach-O/ELF/etc. formats lacking Ada features, lead to adoption of additional ALI files.
    10:06 gprbuild serves me well enough that I even use it for pure C and C++ projects if I can decide about toolchain, but cannot decide about programming language. It can handle static or shared libraries. I miss grpbuild in Delphi. And I miss gprbuild in AdaMagic. It's Alire, the next layer, that is sometimes questionable, but gprbuild is good.
    17:18 It's not a problem it's written in C. The problem is that it's written in C in an unlinkable way. Without COM. In 1990s OS/2 guys were laughing at Windows guys for having such a pathetic COM thing, no match for IBM SOM, but now we are on Linux, and Linux does not even have COM as a common thing. We are degrading on Linux. On Windows programmer would make COM facade for a library and then Python automatically generates binding from TLB. COM library vendor provides freedom to use library from Ada, Delphi, whatever. On Linux developers provide direct bindings. Direct binding from Python to a specific library, and that direct binding is not usable for other languages.
    By the way, for COM analogue on Linux I would recommend VirtualBox XPCOM as opposed to Mozilla XPCOM.
    17:43 Some useful unsafe code could be hardened by CCured. CCured is the "interesting thing in C compilers"
    19:48 You don't need Interfaces.C for interfacing with C. You need aspect Import or pragma Import and aspect Convention or pragma Convention with value C. Aspect is like attribute in COM IDL, Delphi and .NET. Aspects appeared lately in Ada, and old pragmas can be written in either syntax.
    Interfaces.C package is for C types. Sometimes long ago there could possibly be a situation where Ada Character is not the same as C char, and Ada Integer is not the same as C int, and for that matters Interfaces.C.char is what surely shall match C char. Nowadays it's all so ridiculous, it's legacy, and let's just use ordinary types.
    23:37 Niklaus Wirth had big regrets about retaining from Algol begin-end in Pascal. He fixed his mistake in each and every subsequent language, starting from Modula and all the way to Oberon. Ada also has fixed this error. But they all together failed to phase out old bad Pascal, and this shame persisted. Each new RemObjects Oxygene inherits from shameful Pascal and does not contain fixes. What a pain.
    25:33 Not perfect, but that comes from C developers. Usually it's convenient to make automatically generated bindings and they copy-paste manually reviewed pieces of source text. Also I've heard about Ada plug-in for SWIG, but don't know how mature it is. I recall the author tried to bind wxWidgets, and in wxWidgets there is a copyable class inheriting from non-copyable class, and such mind tricks do not map to Ada well. I have missed if SWIG became a real thing for Ada.
    35:50 This is from Pascal. Not originated in Ada. And I am not sure about Pascal origins. Maybe Algol had it before. If compatibility is desired then: subtype Xs_Index is Integer range 1 .. 200; If compatibility is not desired, then it's possible to write type Xs_Index is new Integer range 1 .. 200;
    Turbo Pascal and Delphi also have similar syntax: type A = type B. But the wall between A and B is not as thick as in Ada. Delphi vendor does not study Ada and does not deliver features that Ada has for decades. Delphi customers also don't know Ada and don't demand. What a pain.
    37:12 SPARK did not have pointers for a long time, but there was a container library for it. IIRC GNAT GPL 2012 is the latest one to contain it. Those containers had predefined capacity and used array of full capacity size. Map was implemented by balanced tree and array indices
    39:35 Yeah, I tried to explain this to Rust programmers, how broken their enumerations are, but they have conversion to Integer, and they think it solves all the problem. Indeed I like how Pascal family languages enable organizing stuff on low level with convenient building blocks.
    40:32 Indeed, another nice feature that I just can't get in another languages. Not in Delphi, not in Rust. Not a rocket science, but they won't do.
    41:12 And that's huge omission from Ada. Unlike Pascal, Ada parameters are read-only by default, but ordinary variables are mutable. So we're stuck with writing constant. That surely improves readability and reasoning. Rust started later and made immutable by default, that is certainly a good thing. Delphi has recently introduced inline variable declarations with assignment. Alright, but next logical step would be inline constant declarations. But one needs to know Ada to know one's next steps in language evolution, and Delphi vendor lacks that wisdom.
    42:43 Speaking about abstraction, you can instantiate Ada.Containers.Vectors with "type Some_Index is new Positive;"

  • @lowlevelcodingch
    @lowlevelcodingch 27 วันที่ผ่านมา

    I didnt even notice this is the other channel, finally you uploaded again! 🤣

  • @im_gin
    @im_gin 27 วันที่ผ่านมา +4

    Finally! The main “Tsoding” channel got a new video 🎉
    (First 5 seconds I thought this was another video on Tsoding Daily channel lol)

  • @chandragunawan4105
    @chandragunawan4105 27 วันที่ผ่านมา

    i didnt expect i would enjoy this long video. you did a great job, the third owner of the channel.

  • @sealoftime
    @sealoftime 27 วันที่ผ่านมา +5

    Thank you for covering Ada! I'm a total smelly nerd for this language. Really wish there'll be more videos about it!

  • @FDominicus
    @FDominicus 13 วันที่ผ่านมา

    One of the greatest videos from you. It’s really remarkable .

  • @RockyDesigne
    @RockyDesigne 17 วันที่ผ่านมา

    Hey man, you're really cool.
    I am watching the streams on twitch where you were developing Ada, and I am glad you finished it on stream.
    I really enjoy watching you program and seeing how you think, you're like the programmer I aspire to be really.
    Thanks for the vids and all the work.

  • @starc0w
    @starc0w 4 วันที่ผ่านมา

    That was awesome! Thank you so much! 🍀✨

  • @y00t00b3r
    @y00t00b3r 27 วันที่ผ่านมา

    Instant subscription.
    I had an Ada course in college 30+ years ago.

  • @diegorocha2186
    @diegorocha2186 26 วันที่ผ่านมา

    Holly shit, this is an amazing video!!! I really liked the style and how you approach the demo! I'm wondering if you will upload the ada session in entirity on your daily channel, really loking forward in watching it!!!! Thanks!!

  • @mahdiaghaei8154
    @mahdiaghaei8154 19 วันที่ผ่านมา

    Love this kind of content!❤
    It would be awesome if you could make courses Tsoding!

  • @fr3fou
    @fr3fou 28 วันที่ผ่านมา +2

    he's back

  • @friggindoc
    @friggindoc 23 วันที่ผ่านมา

    This game looks insanely cool! Props to you man

  • @BrianBurciaga
    @BrianBurciaga 27 วันที่ผ่านมา +1

    I just finished a course on Safety and Security and our labs were in Ada. Nice to see something in the obscure lang

  • @motbus3
    @motbus3 27 วันที่ผ่านมา +1

    Oh Man. I was looking this channel the other day wondering if you would revive this channel besides the daily one

  • @tamantaman
    @tamantaman 26 วันที่ผ่านมา

    This video is very very instructive, thank you sir :)

  • @kodosunofficial
    @kodosunofficial 27 วันที่ผ่านมา

    Yes!!!! This channel is alive

  • @orestissabethai830
    @orestissabethai830 24 วันที่ผ่านมา

    The game looks great and the video was very informative. Thank you!

  • @vicktorioalhakim3666
    @vicktorioalhakim3666 27 วันที่ผ่านมา +5

    As a FPGA engineer used to VHDL this language hits right home!

    • @r2com641
      @r2com641 27 วันที่ผ่านมา

      vhdl sucks and its not ergonomic and its absent sensitivity to letter case is retarded

    • @juanpauloazaelpalacios-vil5422
      @juanpauloazaelpalacios-vil5422 23 วันที่ผ่านมา +1

      VHDL mentioned, auto like 🦅🦅🦅

    • @bloodgain
      @bloodgain 20 วันที่ผ่านมา

      Not surprising. One of the few areas where Ada still has a large (for the industry) following is embedded programming, which is a next-door neighbor to FPGA programming.

    • @earx23
      @earx23 16 วันที่ผ่านมา

      That's because VHDL was actually based on ADA. ADA was already intended to be a replacement for C in the late 70's. It had military roots.. just like VHDL.

  • @SuperNolane
    @SuperNolane 24 วันที่ผ่านมา

    Indices are natural part of abstract container semantics. While iterator (pointer) invalidation rules are a detail of some specific implementation.

  • @jongeduard
    @jongeduard 20 วันที่ผ่านมา +1

    Thanks for another great video! Made me curious about exploring Pascal again. Turns out Pascal has quite exactly those same features with indexing and enumerations! I knew about those enumerations, but I wasn't sure about the array indexing aspect. Now I tried it on linux with freepascal. Ada en Pascal are very similar here too. Actually great, also from memory safety perspective.
    Somehow, many years of having to work in someone else's existing Delphi code (which is really just a Pascal dialect) never invited me to explore every aspect of the language myself. Especially also because none of those good things where ever in all that code. And I have always been more a C family languages guy and worked with C# too.
    Maybe Ada is more memory safe on other aspects as well, or the compiler does more checks, I don't know. But both Pascal and Ada deserve actual credits I think.

  • @TsvetanDimitrov1976
    @TsvetanDimitrov1976 27 วันที่ผ่านมา +33

    If I had a $ for every language that was suposed to replace C....

    • @kevinchadwick8993
      @kevinchadwick8993 27 วันที่ผ่านมา +3

      It has replaced C for me and it is so much better that words would not suffice. Truly I say to you that Ada is the best language for embedded, memory registers/drivers and network protocols.

    • @MultiPoiu
      @MultiPoiu 27 วันที่ผ่านมา +6

      I think you might get 20-50$ for those

    • @EduardoEscarez
      @EduardoEscarez 27 วันที่ผ่านมา +5

      The point of the NSA recommendation (and also the general one from the White House) is that C (and C++ to certain extend) has been problematic due to bugs and memory safety, while that could be a skill issue of the programmers, we still have those problems since several decades because there isn't a good solution for them due to the nature of the languages.
      What they are saying is more nuanced, like "if this program can be written in a memory safe language, do it that way" which should be the first consideration in many areas where cybersecurity is critical. And even they say that are areas where C cannot be replaced like avionic or satellite systems, where the garbage collector nature could be a great problem.
      At the end their intention is not to replace C but only using it in areas were its capabilities are a requirement.

    • @stolenlaptop
      @stolenlaptop 27 วันที่ผ่านมา +3

      ​@@EduardoEscarez So use a language written in c instead of c itself. Checks out.

    • @LukeAGuest
      @LukeAGuest 27 วันที่ผ่านมา +2

      I replaced both C and C++ with Ada in 2005.

  • @caddr
    @caddr 27 วันที่ผ่านมา +1

    Finally, tsoding remembered the password, and started uploading a new video

  • @jccosta78
    @jccosta78 22 วันที่ผ่านมา

    Finally a coding video that I can watch. I just found your channel. Keep the good work! Exta bonus: he codes in Emacs! 😀

  • @ludolpif
    @ludolpif 25 วันที่ผ่านมา +1

    Very cool coverage of all steps to try this by myself, after 10 years of not writing any ADA line code :) Was used as base language to teach procedural programming in some French high-school. Planes produced in France are / were shipping ADA code as critical code for flight. Trading in the biggest bank company from here have / were actually got production code in ADA too.

  • @SlinkyD
    @SlinkyD 27 วันที่ผ่านมา +1

    *Jeezy Voice: Welcome back, welcome back
    This got a 1990s elementary "The Learner Will" video mixed with PBS documentary vibe. You got a spicy bag o talent.

  • @FunkschyIsWatchingYou
    @FunkschyIsWatchingYou 27 วันที่ผ่านมา +1

    A new "main" channel video. 2024 is a good year AYAYA

  • @ayoubelmhamdi7920
    @ayoubelmhamdi7920 27 วันที่ผ่านมา

    this channel still working

  • @muhammadmustafa3158
    @muhammadmustafa3158 12 วันที่ผ่านมา

    Great video Mr zozin !

  • @MadMathMike
    @MadMathMike 24 วันที่ผ่านมา

    I'm only 3 days in, and you built that in 20 days?! That's actually amazing!

  • @popcorn109i
    @popcorn109i 27 วันที่ผ่านมา

    Witness font for section headers?
    Nice vod btw

  • @murilloventura2823
    @murilloventura2823 27 วันที่ผ่านมา +1

    Literally the best code streamer

  • @user-wb5tr9wl5f
    @user-wb5tr9wl5f 25 วันที่ผ่านมา +1

    Cooool!!!
    He finally become a TH-camr!!

  • @sanjarkuliev7770
    @sanjarkuliev7770 10 วันที่ผ่านมา

    очень крутой видос получился.
    thanks bro! the edit is concise and captivating.
    you really help me get my motivation going. you see, i think i started burning out at work around a year ago, i took a couple of months off work, and tried to recover, but ever since i've been having troubles keeping myself motivated at programming (even my own side projects)
    so i wanted you to know: i appreciate the work that you do like making content and editing videos, it helps me getting through these tough couple of months. thank you

  • @jawad9757
    @jawad9757 25 วันที่ผ่านมา +1

    Does it really count as circumventing the borrow checker when you still have to immutably or mutably borrow to actually get/set the data in the vector/array?

  • @hugosales8102
    @hugosales8102 27 วันที่ผ่านมา +3

    Totally agree with the take about reading the source. People seem to think libraries are magic.
    A funny aside, is that, among friends, we've been referring to reading the code as the "russian docs" xd

  • @codeplay4947
    @codeplay4947 27 วันที่ผ่านมา

    hey how can you share your discord channel link
    ???

  • @Stockwise-jt8yp
    @Stockwise-jt8yp 23 วันที่ผ่านมา

    awesome video
    keep making such videos

  • @blastygamez
    @blastygamez 27 วันที่ผ่านมา +1

    Now this guy is what I call a professional good programmer ^-^

  • @saqibshafin
    @saqibshafin 24 วันที่ผ่านมา

    35:17 ...and that will actually work...almost...
    I love the way you present.
    I came for copper, and I found gold - your works are indeed gold to me. IMHO.

  • @connorlatham9578
    @connorlatham9578 26 วันที่ผ่านมา +2

    Some of the expressiveness at the end reminds me of Apple's new language Pkl. For those types that are ranges, do you need to use them like enumerations or can you perform arithmetic? And if you can perform arithmetic, how does the type behave if it overflows? Maybe I just need to read the docs... Fascinating video, thanks for taking the effort here to break this all down.

    • @connorlatham9578
      @connorlatham9578 26 วันที่ผ่านมา

      I ask how they behave because I think it relates strongly to a lot of the "try_" style functions in Rust, and the complexity that seems to drive downstream to a dev.

    • @connorlatham9578
      @connorlatham9578 26 วันที่ผ่านมา

      It's really fascinating that Ada seems to take this route of add complexity to language "words" to improve relationship expression between them instead of driving that to the runtime of the program. I wonder if so many languages seem to have a small set of source symbols because they are developed by English-speaking workers as opposed to German or Chinese. Where a single word is as expressive as a whole sentence in English.

  • @EkShunya
    @EkShunya 24 วันที่ผ่านมา +1

    welcome back

  • @benmarr5128
    @benmarr5128 24 วันที่ผ่านมา

    I've been enjoying your stream and the Tsoding daily channel, but this long form edited style really fucking works nice man! I came across Ada when working for a company that provided code analysis tools for safety critical applications. Ada seemed to be a relevant choice in these areas.

  • @exzeltgaming
    @exzeltgaming 19 วันที่ผ่านมา +1

    Could you make one on D lang? Interested to hear your thoughts on it

    • @brambasieldev
      @brambasieldev 18 วันที่ผ่านมา

      Would also like seeing videos of it used as a C/C++ or Go alternative as I think it's an underrated language.

  • @notnrrful
    @notnrrful 23 วันที่ผ่านมา

    Sweet! Someone else really, really likes how array index types work in Ada. It was starting to feel a little lonely.

  • @rubberduck2078
    @rubberduck2078 8 วันที่ผ่านมา

    the title is genius

  • @alexandermaximilianoetken7265
    @alexandermaximilianoetken7265 27 วันที่ผ่านมา +1

    Since Ada is memory safe but not garbage collected, how does it handle dynamic memory allocation and deallocation? Or does it not have that feature and you have to allocate things statically?

    • @LukeAGuest
      @LukeAGuest 27 วันที่ผ่านมา +1

      There is a new keyword and a generic procedure, Unchecked_Deallocation which you instantiate to free it. The language could always have a GC if the implementer's wanted to, it was allowed from the initial versions and iirc some of the original research compiler's had it, but they were also nothing more than an extended Pascal back then, the papers are available on the acm.

  • @alecs2056
    @alecs2056 27 วันที่ผ่านมา +3

    37:00 I don't understand how this is supposed to circumvent the borrowchecker, the owner of the memory is still the list, regarding remembering in what list you are indexing I believe it can also done in rust (I'm not a rust programmer but I can do it pretty easily in Haskell)

    • @oscarsmith-jones4108
      @oscarsmith-jones4108 27 วันที่ผ่านมา +3

      The fundamental reason for the borrow checker is to ensure that any values are not accessed after they are gone. For example, at any point in C++, you can delete() something that is later needed by another function - this is unsafe code. A similar problem can occur if you move memory from one region to another, you might move some memory somewhere else but the calling code still expects it to be in the same place. To allow moving and deleting (for performance) while being safe, Rust uses the borrow checker which forces the programmer to structure the code in a certain way to catch these use-after-moves and use-after frees.
      One of the things it does is prevent the programmer from having multiple mutable pointers - if you can modify the underlying data from multiple places, you might accidentally move some of it's contents while it is needed somewhere else (if you are aware of how lists/vectors are implemented, this will make more sense). This is a potential problem that Rusts prevents by only allowing one mutable pointer at any one time.
      Indices are essentially pointers, but Rust doesn't pose the same restrictions on them so you can have multiple mutable indices and the borrow checker won't catch it, even though the same issues can occur. Ownership is a different concept and that prevents multiple frees() which can cause a crash if you try to delete something that is already deleted. Essentially, borrow checker prevents changing a value from different places.

    • @alecs2056
      @alecs2056 27 วันที่ผ่านมา +4

      Yeah but the memory is owned by the data structure not the pointer, so you can have at most one mutable reference of that regardless of any pointer so such thing cannot happen

    • @oscarsmith-jones4108
      @oscarsmith-jones4108 27 วันที่ผ่านมา

      @@alecs2056 The point is you can have more than one mutable reference if you use indices instead of pointers. Mutable just means it can edit the value it doesn't have anything to do with ownership. Ownership doesn't help with use-after free it helps with double frees.
      Even if the memory is "owned" by the data-structure it doesn't prevent indirect manipulation by pointer/index .You can, for example, append to a list while another thing is using the list. This might sound okay because the list has a single owner, but if the internals are moved somewhere else, then the other places need updating otherwise they might read something invalid from where the internals used to be. Rust prevents multiple mutable pointers, but multiple mutable indices are just fine. That's why you are able to "get around" the borrow checker by using indices. The point is ownership doesn't solve all problems, you still have problems if the owner does something weird under the hood, so you need controlled access to that owner.

  • @ManderO9
    @ManderO9 28 วันที่ผ่านมา

    he is back

  • @yan-amar
    @yan-amar 27 วันที่ผ่านมา +4

    43:04 Justice for Ada!

  • @rapsoydc
    @rapsoydc 21 วันที่ผ่านมา

    Thank you so much for the time you have taken to make this video. This is the second time I muster up the courage to reach out to you regarding which path to take in the field of programming languages. Perhaps you or one of the readers could guide me, especially since I don't have anyone else in my area to ask for advice. Towards the end of the video, you mentioned integrating Ada into a resume to land a job in the programming industry. I believe you answered no, and truthfully, I am unsure which language to turn to for this purpose. I'd like to express my interest in programming by learning a language that would allow me to secure a remote job. Thank you very much. I understand you may not have the time to reply personally, but if anyone from the community could offer guidance, I would be immensely grateful.

  • @JohnDoeNobody
    @JohnDoeNobody 28 วันที่ผ่านมา +2

    Yippie!

  • @dariofagotto4047
    @dariofagotto4047 24 วันที่ผ่านมา +1

    So in Ada arrays can be mapped by ranges and enumerators (*like in pascal*) :) a lot of interesting things are present in pascal that should be everywhere like native bit sets for enumerators etc..., curious about the concurrency and other things of the language tho, will look into it!

  • @turtleDev32
    @turtleDev32 27 วันที่ผ่านมา +1

    Average Tsoding moment

  • @rafaelbordoni516
    @rafaelbordoni516 27 วันที่ผ่านมา

    Finally managed to kill that last boss, good job on the mechanics, pretty cool for a 20 day challenging while learning a new language! How do I cheese it though?

  • @judahwilson6756
    @judahwilson6756 24 วันที่ผ่านมา +1

    This game looks actually dope

  • @skejeton
    @skejeton 27 วันที่ผ่านมา +1

    ahh, finally someone said about how indexes are similar to pointer (and why it's basically a way to circumvent the borrow checker lol)

  • @eazypeazy8559
    @eazypeazy8559 27 วันที่ผ่านมา

    this format is hot!

  • @juanpauloazaelpalacios-vil5422
    @juanpauloazaelpalacios-vil5422 23 วันที่ผ่านมา +1

    As someone who uses VHDL for digital designs, thanks for covering Ada! Wondering if I can use Ada for embedded software too 🤔

    • @bloodgain
      @bloodgain 20 วันที่ผ่านมา +1

      Absolutely. It's one of the few disciplines where Ada is still somewhat popular. It lends itself quite well to low-level systems.

  • @tremon3688
    @tremon3688 22 วันที่ผ่านมา

    ADA has lots of features integrated into it. At uni I used it to program realtime systems

  • @maksymiliank5135
    @maksymiliank5135 24 วันที่ผ่านมา

    the type system in ada seems to be very neat. Really like how expressive it is without any comments

  • @user-cy1rm5vb7i
    @user-cy1rm5vb7i 27 วันที่ผ่านมา

    28:30 I usually use msys2 in a windows virtual machine for that exact purpose. It comes with pacman plus some gnu tools + bash, so it's almost just a drop in replacement for me, since I use make for building stuff

  • @diadetediotedio6918
    @diadetediotedio6918 23 วันที่ผ่านมา

    17:39
    So, this is an interesting take in many ways, but are you considering the possibility of making applications by making code in safe languages? I don't think it is a justified argument to draw that, from the fact we use past-written C/C++ code to make useful things, it implies that it "vanishes" the safety benefits of safe languages.

  • @FEiSTYFEVER
    @FEiSTYFEVER 22 วันที่ผ่านมา

    You can have a look at the secure subset of Ada called SPARK, which implements design by contract. A great concept that more languages should adopt.

  • @sandrojukovic20
    @sandrojukovic20 11 วันที่ผ่านมา

    Interesting format of videos. Was listening while washing dishes and then Ada kinda reminded me on PL/SQL. I googled that, it turns out Oracle borrowed syntax from Ada.

  • @lhpaoletti
    @lhpaoletti 16 วันที่ผ่านมา

    Are you going to post the Eepers VODs in the Tsoding Daily channel? I can't find them somehow, so I thought that you don't have them posted yet

  • @alexpyattaev
    @alexpyattaev 25 วันที่ผ่านมา +1

    Array and enum integration is something I miss dearly in most languages.