Demo: Base language, compile-time execution

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ต.ค. 2014
  • A demo of a prototype programming language. Illustrates ideas from the previous two talks.
    The demo itself is only about an hour and ten minutes; the rest of the video is questions & answers.
  • เกม

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

  • @Kavukamari
    @Kavukamari 7 ปีที่แล้ว +105

    i love the "you must defeat x invaders to compile" prank

    • @PotatoGameDev
      @PotatoGameDev 5 หลายเดือนก่อน +3

      I would go a step further and actually make it a mandatory part of the build. In the language specification. Please.
      (Also, we should make it a thing. Lets call it a new best programming practice and try to do that in the business app languages like Java... I want to see a daily scrum where a developer says they couldn't make a progress in the task because they can't kill those 10 aliens).

  • @JJC1138
    @JJC1138 9 ปีที่แล้ว +36

    This all sounds extremely exciting, and I can hardly wait to see how it develops and maybe get involved once it's public. Thanks for taking this on!

  • @GodOfMacro
    @GodOfMacro 9 ปีที่แล้ว +10

    I really love that we can add our own checks and test at compile time, that is really a beast feature. Amazing to see all that stuff working already.
    I'll try this out for sure.

  • @rosegolden1792
    @rosegolden1792 9 ปีที่แล้ว +50

    I really like the idea of running functions at compile time.
    You could write a function that loads a texture or font as bytes and then embed it into the program for runtime. Small games could really benefit from this.

    • @thegrandnil764
      @thegrandnil764 ปีที่แล้ว +3

      forth has been doing this for 40 years

    • @cyanide0081
      @cyanide0081 9 หลายเดือนก่อน +1

      @@thegrandnil764 ok

  • @goranmilovano
    @goranmilovano 9 ปีที่แล้ว +17

    It's really happening!
    Thank you Jonathan - My hope for a better future is now restored!

  • @user-tt4dy1ti5v
    @user-tt4dy1ti5v 2 ปีที่แล้ว +14

    Q&A
    1:16:21 [Jon showcases the invaders game running on Linux.]
    1:20:32 (This is not really mind-blowing multi-platform.)
    1:21:58 Will strings be natively UTF-8 by default?
    1:22:30 Will the compile-time generation always target bytecode?
    1:24:32 What are your feelings on tail calls?
    1:24:50 Plan to support multiple return values?
    1:26:13 Have you considered using LLVM to generate optimized code (instead of compiling to C)?
    1:26:40 Would you plan on adding game programming specific implementations of cache-friendly data structures as core features to the language?
    1:27:10 Is the language its own preprocessor?
    1:28:14 Plan to support SIMD?
    1:28:20 Can you use 'defer' to do removals from an array after looping through it?
    1:29:08 Why were captures not shown in this demo?
    1:29:40 [Jon showcases the invaders program, which is 950 lines of Jai code.]
    1:31:28 [Jon previews the upcoming 'remove' keyword feature.]
    1:33:09 [Jon discusses the lack of arrow syntax for pointers to structs.]
    1:33:45 What you do think of the UFCS (Uniform Function Call Syntax) in D and proposed for C++?
    1:34:59 How do you interface with libraries written in other languages?
    1:35:20 [Jon showcases modules, #import, #foreign.]
    1:36:15 [Jon mentions dyncall.]
    1:36:40 [Jon mentions linking problems with cosf(), sinf(), strdup().]
    1:37:08 [Jon mentions void return types and inferred return types.]
    1:37:30 [Jon showcases enums.]
    1:38:04 What license are you going for?
    1:38:35 What do you think John Carmack thinks about this language?
    1:38:45 Why do you think this language will make garbage software less common?
    1:39:52 Are you considering using the MIT license?
    1:40:22 [Jon discusses why building this language publicly and open source from the start is a bad idea.]
    1:41:11 [Jon mentions the issues with Microsoft Visual Studio.]
    1:41:43 [Jon mentions the issues with GNU Emacs.]
    1:42:05 Plan to support concurrency?
    1:42:20 Plan to build a new operating system?
    1:42:42 What do you dislike the most about C++?
    1:42:55 (Emacs Lisp: 10/10 best language, right?)
    1:43:06 Plan to support custom allocators?
    1:44:05 Would there be any containers similar to C++ STL containers?
    1:44:32 Why C/C++ for the compiler's language? Have you considered Go?
    1:44:43 How do feel about Lua?
    1:44:55 Would it possible for you to document all this?
    1:45:06 When will talk about a standard library?
    1:46:32 (Go does not have parameterized types.)
    1:46:48 Do you envision this language to be embeddable?
    1:47:17 Has The Witness become even harder now that you are working on this language?
    1:48:02 Will The Witness be rewritten in this language at all?
    1:48:24 Is there not a ton of drudgery involved with getting an entire programming language and compilation chain up to production level?
    1:50:06 What are your plans for IDE/tools/debugging support (for this language)?
    1:50:50 [Jon mentions the issues of using an IDE and debugger on Linux.]
    1:51:30 What things do you foresee limiting use (of this language) in game consoles?
    1:52:05 (Qt Creator can be extended.)
    1:53:07 Is C++ interop important to you? Lots of companies have existing C++ code.
    1:55:51 Would you quit all your current projects to come teach at my college?
    1:56:06 How will this project be led if it becomes bigger?
    1:56:21 Does function overloading work currently?
    1:57:18 Are you considering return type function overloading?
    1:58:11 Can you write a shader language, please?
    1:58:44 What about default parameter values?
    1:58:55 What's the next most powerful feature to be implemented?
    1:59:03 What about named parameters?
    1:59:39 Would it be valuable to introspectively get bytecode?
    2:00:00 Do you think of yourself as the Elon Musk of indie gaming?
    2:00:37 [Jon mentions that very few companies in the San Francisco Bay Area are trying ambitious things.]
    2:00:58 [Jon mentions the Apollo era of the 1960's when launching to the moon occurred.]
    2:01:20 "I would personally like to, a few years from now, be doing things bigger than this, but this is good step towards something even bigger than this eventually."
    2:01:45 [Jon mentions the 1969 moon landing and how the people then got ambitious stuff done with weaker technology and materials science.]
    2:03:02 Have you seen Alan Kay's group's recent work at the Viewpoints Research Institute?
    2:03:24 [Jon mentions not overthinking a problem -- just sit down and start programming it, and then clean it up later after the program works.]
    2:05:04 Are there any web languages that you like or dislike?
    2:05:50 Plan to build a new Internet?
    2:05:59 (Closing remarks)
    2:07:10 "Don't be afraid to do ambitious projects now."

  • @creatcodebuild7180
    @creatcodebuild7180 3 ปีที่แล้ว +11

    I'm glad that I'm watching this right now. 6 years ago when I just started programming, I won't be able to understand.

    • @nintendude794
      @nintendude794 2 ปีที่แล้ว +1

      Not being able to understand this has reinvigorated my interest in starting to program.

    • @wahffle6729
      @wahffle6729 5 หลายเดือนก่อน

      @@nintendude794 how is that coming along by now?

    • @nintendude794
      @nintendude794 5 หลายเดือนก่อน

      @@wahffle6729 still intermittent and negligible

  • @Danhec95
    @Danhec95 4 ปีที่แล้ว +8

    Defeating more than 10 aliens is the proof of work to compile the program

  • @tylercloutier9675
    @tylercloutier9675 8 ปีที่แล้ว +2

    It's especially inspiring to see that my process is similar to how you tackled this. i.e. First starting with a vague idea, build it out a bit to make it more concrete, taking another idea, and just incrementally and continually improving and cleaning up until your somewhere. It's just so easy to get bogged down in the enormity of the task, it's easy to get discouraged.

  • @GyroCoder
    @GyroCoder 9 ปีที่แล้ว +15

    OOOooohhh. Those compile-time asserts running code in bytecode mean that you basically have unit tests as first-class functionality in your code. That's fucking amazing.

    • @nexovec
      @nexovec 2 ปีที่แล้ว +1

      yeah, except he would tell you to not do those :D

  • @Plasticcaz
    @Plasticcaz 9 ปีที่แล้ว +2

    I actually enjoyed watching this more than I thought I would. Subscribed so I can keep up with your progress.

  • @BSC4PE
    @BSC4PE 9 ปีที่แล้ว +8

    Even tough I am a greenhorn to programming in different languages (I understand most of the things related to programming, it's just a matter of learning those things, and combining them to be an efficient programmer) I understood the vast majority of what you explained, and think that this project is something I would personally be interested in playing with sometime in the future.
    It just seems like you are making the most basic things take less effort and simplifying them to a level, where this language is going to be easy to catch on to and learn. This seems like a perfect thing for me, since some of the "modern" languages have some stupid unnecessarily complex way of doing something that is in reality really simple.
    If this becomes a successful and good programming language (which I have faith that it can) I will most definitely get into game programming more if I haven't by then. I am really looking forward to seeing this thing develop. I have really enjoyed listening to these talks, you seem to have very concrete opinions and tend to explain things very well.
    Thank you for doing this project with a licence as unrestrictive as possible in mind. It makes me glad.

  • @Ribby00
    @Ribby00 9 ปีที่แล้ว +2

    Very cool!
    Side note: Finally went back and finished Braid. Loved it!

  • @NoTruce
    @NoTruce 3 ปีที่แล้ว +2

    Is so cute the "good job" when the printf warning showed up in a natural manner.

  • @edvinholm1
    @edvinholm1 9 ปีที่แล้ว +11

    This is the best thing i've ever watched.

  • @ihrbekommtmeinenrichtigennamen
    @ihrbekommtmeinenrichtigennamen 9 ปีที่แล้ว +1

    I am so excited to watch all of your videos. As I am designing (and hopefully building) a relay computer I would very much like to also write a compiler for it.
    What you have presented here is super interesting. I find the concept of running code at compile-time very weird but also very exciting. I'd love to have something like that in .NET.

  • @hemmper
    @hemmper 5 ปีที่แล้ว +36

    Parsing isn't hard. Optimizing and giving helpful error messages is hard.

  • @hasen1957
    @hasen1957 6 ปีที่แล้ว +1

    Wow this was just the first iteration and it's already better than D and Rust and all the other languages I've seen so far; at least in principle.
    I've just started following Jai now and I'm getting excited about it.

  • @casvanmarcel
    @casvanmarcel 9 ปีที่แล้ว +2

    fantastic work so far! very inspiring

  • @JebBradwell
    @JebBradwell 9 ปีที่แล้ว +2

    You asked if we think this is cool... I'm watching today obviously so I wasn't on the live stream... but I think this if F*CKing Awesome! Totally vibing on your mind and creativity... I feel tickled/giddy inside when I see your insights!

  • @kelyncrandall7452
    @kelyncrandall7452 5 ปีที่แล้ว

    I just found out about this, and I can't wait for release!

  • @aleksievnikolay
    @aleksievnikolay 9 ปีที่แล้ว +56

    You said you need to write in C++ to keep this project going. I think you have enough to bootstrap the jai compiler. "Any self respectable compiler is written in the language it compiles."

    • @kaustubhken
      @kaustubhken 4 ปีที่แล้ว +6

      Nikolay Aleksiev c++ has 20 years of optimisations also he has a llvm and x64 backend for the compiler.

  • @dumitru-alinsimoiu7652
    @dumitru-alinsimoiu7652 8 ปีที่แล้ว +2

    this is really inspirational! thank you!

  • @TheBirkIsReal
    @TheBirkIsReal 9 ปีที่แล้ว

    This look so promising. Reallyenjoyed the checks and asserts
    Im not usually a fan of declaring variables different ways than c/c++/java etc. but this way looks doable

  • @mikkelmogensen
    @mikkelmogensen 9 ปีที่แล้ว

    Very cool! Great work!

  • @s-ol
    @s-ol 9 ปีที่แล้ว +3

    Very cool, looking forward to programs that #run as their own makefiles!

  • @smiley_1000
    @smiley_1000 4 ปีที่แล้ว +3

    Watching this was really inspiring and fun :D

  • @germinolegrand
    @germinolegrand 9 ปีที่แล้ว +16

    When you open source it, please make it public domain as you said in your first video :-) !

  • @kacperozieblowski3809
    @kacperozieblowski3809 4 ปีที่แล้ว +2

    this is awesome!!!

  • @samuelgrahame3617
    @samuelgrahame3617 6 ปีที่แล้ว

    this is really cool, i love the byte code.

  • @MortenSkaaning
    @MortenSkaaning 9 ปีที่แล้ว +1

    very cool :) looking forward

  • @64jcl
    @64jcl 8 ปีที่แล้ว +23

    Looks like a fantastic language to code with and it has so many nice simplifications to make the life easier for the programmer. The #run feature is mindblowing! I can imagine it being a very nice tool for evaluating stuff into whatever data you need to put into somewhere in the code. It would certainly work nice as data importing, and the neat thing is that you dont need to learn a new language for the actual "macro/script". So when can we play with this ourselves? :)

  • @honglouis
    @honglouis ปีที่แล้ว

    just incredible.

  • @Xavier-cd6fx
    @Xavier-cd6fx 6 ปีที่แล้ว +1

    You made a lot a videos, but it is a real pleasure to see them from the start.
    In a way your solution for compile time execution is much more understandable than does D (it can allocates,... and it is super fast). I am sure that in the next videos I'll see how we can use it to generate code (with traits) and how the jai compiler can automatically try to solve at compile time const/immutable expression (for an optimization purpose, that can be pretty interesting with templates).
    I saw the end coming with the #run directive to tell the compiler how to build the whole program. I had always asked my self why build configuration, unit-tests, integration tests,... are always done in other languages than the application. Seriously is there a chance that a C++ dev want to do integration tests in an obscur shell language? It might be a raison why the tests are bad and slow on big projects and can't help the programmers to be enough confident to try a big refactoring,...
    I tried D, but I find that it fall in the same traps of C++, there is a lot complexity and it easily hide performance issues. The -betterC D compiler option should help, but for the moment it doesn't seems well enough implemented (CTFE issues, bad error messages).
    The fact that you are generating intermediate cpp code is really important, because it ease the integration in an existing code base, and this point seems to me pretty critical for the democratization of a new langage that want to replace C or C++.
    About named parameters, I find them useful only when reordering parameters of same types or other refactoring that can break the code (with overloading too). But maybe it is the job of the IDE to throw warnings during this kind of refactoring, and if the language have named parameters it will able to show all functions call that have to be enforce with named parameters before the refactor. The most important job for an IDE to me is his capacity to help me to understand the code, refactor it and debug it. I never found interesting that the IDE cares about the compilation aspects. I am dreaming of one that ease the data visualization during debug (with most of them you just can't see or copy a string content correctly??).

  • @DarthChrisB
    @DarthChrisB 8 ปีที่แล้ว +54

    I can lay my mouse pointer over yours and they match perfectly!

  • @comexk
    @comexk 9 ปีที่แล้ว +1

    Random nitpick: Rust also solves for generic integer types based on the constraints of how it's used, if possible. (The default type if it can't do that was removed at some point, but apparently it's coming back.)

  • @dimarichmain
    @dimarichmain 3 ปีที่แล้ว

    Mindblowing.

  • @Dengakuman22
    @Dengakuman22 9 ปีที่แล้ว

    I just subscribed with hype... *keeps watching*

  • @dagonmeister
    @dagonmeister 3 ปีที่แล้ว +2

    Very enlightening topics covered in this talk and looking forward learning more about the evolution of the language. Haven't seen more than this video so far, but I will continue to follow up Jon's work. While I do that, Jon mentioned he is using a linker to resolve the module import, what linker is he using? Someone from the future talks knows for sure? Thanks!

  • @HiAdrian
    @HiAdrian 9 ปีที่แล้ว +3

    Considering that multi-line statements exist, the abscence of terminators like the semi-colon makes me uncomfortable. I think that just like the colon in written language, it serves a sensible purpose for the reader/user. In short: *please keep semi-colon, curly braces and other such useful markers in.* :)

  • @FalconGames109
    @FalconGames109 9 ปีที่แล้ว +14

    The #run directive looks like it would work really well with compile-time meta-programming. You should implement full (read: Lisp-style) macros to make meta-programming even richer. Also, the "defer" keyword sounds like it could be quite powerful, although it doesn't have all of the functionality of the roughly equivalent "yield" in C#. This language seems really interesting. I can't wait until you share the code so we can all help contribute.

  • @theb1rd
    @theb1rd 9 ปีที่แล้ว

    This is already awesome. For objects I'm hoping for something akin to Lua's metatables.

  • @heartles_xyz
    @heartles_xyz 9 ปีที่แล้ว

    Happy belated birthday!

  • @jakubrogacz6829
    @jakubrogacz6829 5 ปีที่แล้ว

    Man this is epic language. Do finish it.

  • @Beefster09
    @Beefster09 9 ปีที่แล้ว +1

    I love programming by the seat of my pants. I feel like UML and that kind of crap is painful drudgery. I like seeing my programs unfold as I start typing up code and seeing what works.

  • @willmcpherson2
    @willmcpherson2 4 ปีที่แล้ว +3

    This is so awesome. How exactly is the byte code being executed though? The compiler has a built-in interpreter?
    A really good use case for arbitrary compile-time execution is initialising data structures. For example if you know all your hash table key-value pairs in advance, you can run a function at compile time to create a hash table that has 0 collisions. Of course there are ways to do this without compile-time execution but it's so much easier when your run-time and compile-time is the same language!

  • @hpesoj00
    @hpesoj00 9 ปีที่แล้ว +3

    Very cool. I didn't expect you to have a demo out so quickly!
    The syntax and features are all very nice, but I feel that how well you tackle the memory management issues could make or break adoption of the language. Are you planning to decouple objects from their layout in memory? It would be very cool to be able to specify a struct with fields "a" and "b" such that creating an array of the structs would actually place all the "a"s together in memory and all the "b"s together. I feel this would go a long way to allowing "data oriented" design without deviating too much from the traditional object programming model. Perhaps I'll have to wait for the next talk.

    • @strictnonconformist7369
      @strictnonconformist7369 9 ปีที่แล้ว +1

      You need to watch the first 2 videos, and then think about what to ask: he addressed a lot more in videos previous to this one than he did in this demo, as the demo only showed a limited subset of what he has in mind, and actually covers some things he didn't cover in his previous 2 videos.

    • @hpesoj00
      @hpesoj00 9 ปีที่แล้ว

      Strict NonConformist I did watch his first two videos, but I just skimmed through them again in case I missed something. At 1:07:27 in the first video, he talks about joint memory allocations for arrays within the same object, but this isn't really what I was talking about. What I was thinking of is completely removing the need to allocate separate arrays to get cache coherency, and have the compiler automatically "deinterleave" the fields within an array of structs. It just seems more sensible to me for the compiler to automatically handle memory management issues, rather than requiring the programmer to work around the object model in order to get performant code. This approach would mean that you couldn't take the address of an object whose memory is "fragmented" without specifying which fragment to dereference, but I don't know if this is really a problem.

    • @strictnonconformist7369
      @strictnonconformist7369 9 ปีที่แล้ว +4

      hpesoj00 What he proposed previously, while the compiler wouldn't automatically set it up to do either one or the other unless you specified as such, makes total sense from his 85% solution goal: the compiler can't really know what you want/need to optimize, but it allows you to easily change it without big changes to your declarations. There are times when you'll want to vary between an array of structures and a structure of arrays, but that really needs profiling to test properly to determine which is better empirically, since usage cases matter. At least what he proposed previously makes it truly trivial to change it from whatever it was. Maybe he'll make changes to make it far more automatic, I don't know, but I think trying to make the compiler trying to do your thinking for you violates what he has in mind, and adds complexity to the compiler and language ala C++ and all it does for you and to you (its greatest strength and weakness). The observation is, if you have to think about what the language/compiler has to do for it, it won't be a part of this language/compiler, because that's too complex.

  • @autious
    @autious 9 ปีที่แล้ว

    The "defer" keyword is brilliant.

    • @FourzoneGaming
      @FourzoneGaming 9 ปีที่แล้ว

      Max Danielsson Could you link me to the part of the video that contains that please?

    • @autious
      @autious 9 ปีที่แล้ว +1

      ***** around 23 minutes. It allows the programmer to defer a block to the end of the function/block meaning that you can for example have the delete immediately follow a new, without using something like RAII and classes with destructors on the stack

  • @AliEP
    @AliEP ปีที่แล้ว

    I'm using your speech as my background coding music, that's uncommon to me, I think we could be really good friends!

  • @heliogomespereiradasilvafi5622
    @heliogomespereiradasilvafi5622 4 ปีที่แล้ว +1

    love you man, keep the good fight, ignore the bad comments, they r just jelous, u r better

    • @heliogomespereiradasilvafi5622
      @heliogomespereiradasilvafi5622 3 ปีที่แล้ว +1

      @FichDich InDemArsch go do something productive man, i understand that you r sad, but keep pushing.

  • @ManuelBTC21
    @ManuelBTC21 9 ปีที่แล้ว

    32:30 I'd say Scheme style symbols would be a good use for the lone single quote. From what I understand, the compiler keeps track of all the symbols used in the program and maps them on to unique integers. You could also see them as a form of ad-hoc enum. If you wanted to get really crazy and make them portable/serializable the compiler could do a hash of the symbol name instead of keeping a symbol table. But of course if there is a hash collision I don't want to be the one who will debug that code.

    • @JaredFinder
      @JaredFinder 9 ปีที่แล้ว

      One potential problem with this is that your symbol table can get obscenely large. We have pretty much the exact feature you described at my work and the memory dedicated to just storing the string form of every intern'd string can be measured in the tens of megabytes.

  • @casey206969
    @casey206969 15 วันที่ผ่านมา

    50:20
    That's so cool you could start a level editor or any creative application putting a human in the loop (maybe a bit too timely for that), or just general program configuration to make personalized programs.

  • @tylercloutier9675
    @tylercloutier9675 8 ปีที่แล้ว

    This was linked to from the Swift mailing list. This is an awesome video! You are super inspirational. Probably going to end up binge watching a bunch of your videos now.
    Also quick question, what happens if you have a printf function inside of your check_printf function? I assume one of two things, it doesn't get checked or infinite recursion.

    • @jblow888
      @jblow888  8 ปีที่แล้ว

      +Tyler Cloutier This actually works fine.

  • @BGBTech
    @BGBTech 9 ปีที่แล้ว +1

    (lets hope my newlines are preserved this time...).
    but, yeah. parsing isn't really hard.
    my usual solution has generally been to be like "screw it" to any fancy tools, and just use hand-written recursive descent parsers (simple, effective).
    the compiler logic, more so if it is a statically-typed register-machine model, is a little harder. for example, I had a little bit of a pain here recently writing a compiler for a C variant which compiles to a statically-typed 3-Address-Code bytecode variant (vaguely Dalvik-like). but it works, and interestingly, the interpreter is (only) around 11x slower than native code for running a JPEG decoder. it mostly supports C, with a few minor omissions and incomplete features (ex: multidimensional arrays are still incomplete, I am "on the fence" about bitfields, ...).
    I might also later consider writing stuff for compiling my script language to it, but this would require a bit more work at present. the next logical step would be JIT or AOT compilers for x86, x86-64, and ARM.
    the planned object model for this VM is:
    single inheritance + interfaces + dynamic classes.
    the VM would allow both method calls and variable access via interfaces, as well as the ability to assign variable visibility to particular interfaces.
    normal class memory layout is similar to that of C++ classes, but classes may daisy-chain to a key/value map in the case of dynamic classes (which allow adding fields at run-time).
    support for a C++ like language is planned (basically a subset, planned to be part-way between EC++ and normal C++ in terms of feature-set).
    my reason for this was mostly to try to provide a "better" solution to being able to deploy compiled code to several target architectures (and it supports some extensions, like ability to have special ifdefs which are delayed until JIT/AOT time).
    I am a hobbyist and this is mostly for personal use.

  • @blenderpanzi
    @blenderpanzi 8 ปีที่แล้ว

    What I think would be useful: Tell the compiler that (if initialized) all variables of a certain type (could be a pointer type) need to be passed to a certain function when they go out of scope (and aren't returned or otherwise passed ownership). So you can say FILE* needs to be passed to fclose. You still see everything that happens like in C (unlike in C++) but you don't forget calling fclose. That combined with defer would be nice. Just some random idea.

  • @FreeScience
    @FreeScience 9 ปีที่แล้ว

    I know I'm a bit late and someone may have said this: your compile time factorial may have worked and simply blocked the rest of the compilation. After you pressed ^C the factorial perhaps has statically inserted into the binary/c-source.

  • @Pyromuffin
    @Pyromuffin 9 ปีที่แล้ว +1

    Whoah, how did that ROT13 thing work? You have a #run in a string, that is already running in the compiler, so the compiler then runs the decrypt code on the argument, and then the compiler re-compiles the code after its been ROT13'd? How do you know how many passes to do? Until you run out of #directives?
    OH, rewatching it, I missed the add_build_string the first time around. Very neat.

  • @LizardanNet
    @LizardanNet 9 ปีที่แล้ว

    so much better than c++. thanks for taking the initiative. BTW, what's your twitch channel and what times do you stream?

  • @MarkoMikulicic
    @MarkoMikulicic 2 ปีที่แล้ว +1

    Can you use compile time evaluation to run checks at compile time for ... code evaluated at compile time at another level?

  • @Girugi
    @Girugi 9 ปีที่แล้ว

    I always program with warnings as errors, and with the warnings for padding of structs and classes, ensuring that I don't unnecessarily waist memory, and looking at this, it feels a bit more confusing to arrange structs when the type of a variable is written after the name... why was it necessary to change a such convention? I don't really see the benefit in having the name first...
    This also brings me on to another question concerning memory/padding... like, in C++ you can write:
    bool a:1;
    bool b:1;
    bool c:1;
    bool d:5;
    If you want to have bools that takes up less memory and don't want to use bit operations on a byte instead. (sure, there are some limitations, so it's not useful in all cases though)
    I really like that option, will this language have something similar, and if so, what would the syntax be?
    a :bool:1; ??
    If people don't want the language to support this, I would be curious to know why.

  • @majidarifs
    @majidarifs 9 ปีที่แล้ว +7

    This guy is so familiar, hmmmm, aaah, the guy who wrote Briad :D

  • @JebBradwell
    @JebBradwell 9 ปีที่แล้ว

    Profiling done by the compiler as well might be interesting....

  • @walter0bz
    @walter0bz 9 ปีที่แล้ว

    is it going to get tagged unions along the lines of Rust's enums ... these are really handy for messages, state machines etc, I do think they'd be useful for games.
    Inbuilt dynamic arrays.. are you likely to follow a 'go-like' direction of trying to have a few common collections inbuilt, or will you eventually rely on a template system to implement everything.
    if the language knew about float32x4 as an intrinsic type, maybe you wouldn't need so much complexity elsewhere

  • @paulfrischknecht3999
    @paulfrischknecht3999 9 ปีที่แล้ว

    A slight problem with the "declaration order does not matter" is that it does matter within functions, so it's a bit inconsistent. If you were to copy a bunch of functions defined globally into a function (because you actually don't need them globally), it might not compile anymore. You might even have to come up with quite some contraption if you had functions that were mutually referring to each other.

    • @localatticus4483
      @localatticus4483 8 ปีที่แล้ว

      +Paul Frischknecht | The difference is that functions are executed in order, obviously, where things in global scope aren't executed at all. Because of this, things in global scope needn't be declared in order either. The mess of forward declarations and header files in C/++ stems from that idea, and that idea isn't a very good one.

  • @katanaswordfish
    @katanaswordfish 9 ปีที่แล้ว +19

    Hey Jonathan, great work so far. It's great to see your idea coming together in such a short span of time.
    This isn't the most crucial thing, but I hope you consider stripping more "C-isms" out of the syntax where possible, as it would probably be a wasted opportunity to needlessly adopt cruft from C and C++ when we might be able to do better. For example, using semicolons as punctuators - what do we gain from this syntax? Sure it allows us to write multiple operations on a single line, but do we want that feature? Even if we ~do~ occasionally want multiple small operations on a line, why not reserve them for that particular use case? Why can't they be omitted in single-operation lines? If this new language makes heavy (more so than C and C++) use of ":", isn't it visually unclear to make heavy use of ";" in a totally different context? Could we make code cleaner, simpler, and less prone to stupid, trivial, punctuation errors? If so, maybe the same thought process can be applied to commas between enumeration entries? What is the justification for these kinds of punctuators on single lines of code beyond their legacy in C and C++?
    Similarly, what's the benefit to using curly braces to define a scope instead of simple indentation (see; Python or Lua)? Of course, indentation means that white-space is now important (maybe that's something we don't want), but it also encourages good coding practices (clean indentation, minimizing logical paths, etc.) and helps to unify style. I don't think that one is objectively better than the other, but it's worth considering because if we don't use braces for scope they can be used for some other feature with arguably improved clarity.
    Something to think about, at least. If this language isn't aiming for syntactical compatibility with C and C++, it means we have the chance to hit the reset button and we should take every chance to question the features of C and C++. I think it's important not to think "semicolons and braces never give me trouble so they're fine".. Instead we should be asking, "How do these legacy features benefit us? How do they make our lives easier? Can we do it better/cleaner/smarter than before?"... C++ didn't have the 'advantage' of starting with a blank slate, and as a result it inherited many features of C which have lead us to where we are now. It's important to consider changes while the language is young and they are easy to make.
    Thanks for your time and effort!

    • @benjaminpedersen9548
      @benjaminpedersen9548 9 ปีที่แล้ว

      I don't think you have to restate his goals to him, and I imagine that he agrees about semicolons, but you should write these suggestions the E-mail address that he specified the talks.

    • @katanaswordfish
      @katanaswordfish 9 ปีที่แล้ว +2

      I'm not restating his goals, just contributing my opinion on why some (pretty trivial) aspects of the language's syntax might not be totally in line with achieving those goals. If I simply said that instead of providing examples, i'd be making a weak case, right?

    • @soulstudiosmusic
      @soulstudiosmusic 9 ปีที่แล้ว +4

      I agree re: semicolons, but whitespacing generally creates more issues than it solves (how do you evaluate hard tabs vs collections of spaces?). Bracket indents are clear, clean and allow for easier subcode-matching than whitespace alone.

    • @DreadKyller
      @DreadKyller 9 ปีที่แล้ว +1

      One benefit of semicolons is not just the ability to write multiple statements on a single line, but the ability to write a single statement on multiple lines. When you're dealing with complex tasks that require multiple layers (example a function1(function2(function3(function4(function5(2,function6(4))),4,function7())) it's much easier to visualize that line if you can span it over multiple lines of code and have proper indentation, the fact that you can minimalize it later by removing the returns and indentation and make it a single line is fine, but for debugging it can be helpful to be able to visually see the function structure.
      If you remove these syntactical objects what do you do to separate instructions? do you move on to 1 line equals 1 statement? If you remove curly braces what do you do to define scopes? Do you become a language with the same structural layout as python? In my opinion that's bad.

    • @soulstudiosmusic
      @soulstudiosmusic 9 ปีที่แล้ว

      DreadKyller
      There's no need to have non-optional semicolons merely for the uncommon use-case of needing to split a statement over several lines - in that case you use a character signifier to show we're ignoring the newline. This is what C++ does with macros.

  • @willmcpherson2
    @willmcpherson2 4 ปีที่แล้ว +1

    Parsers and terminal emulators are impossible to make! What kind of magical technology would allow us to process characters?

  • @forcas1
    @forcas1 9 ปีที่แล้ว +4

    I think that abstract state, as found in Jonathan Aldrich's research language Plaid, would be useful for game programming. I'm not sure if that has anything to do with this video, but I just wanted to have the first post. I was the first viewer, so why not?

  • @ian3084
    @ian3084 11 หลายเดือนก่อน

    I am curious about the order of initialization. C/C++ really had this problem for decades (I don't know if current compilers have fixed it), and it had the contraint of initializing in order. How would that work if this constraint is not even there?

  • @JebBradwell
    @JebBradwell 9 ปีที่แล้ว

    Also another thing with the language would be documentation and coding standard checking baked right into the compiler... to make sure that we have coded to coding standard spec... (inspiration : www.php-fig.org/psr/psr-2/) as well as a documentation manager which keeps track of all code which has been commented or not and makes a listable screen of both... as well as a comment reference checking which would both check if a comment is out of data because it's coupled code segment was changed as well as any other function's which have comments that are say dependent on a function you have changed else where).

  • @MuresanVladMihail
    @MuresanVladMihail 9 ปีที่แล้ว

    Will it work for mac or android? Can i use sublime text to compile the programs?How`s the performance compared to java for example?

  • @intrepidis1
    @intrepidis1 9 ปีที่แล้ว

    A nice easily readable language, what’s it called? Jon’s Awesome Inferer? I wish the variables were immutable though. I guess it’s meant to be halfway between a solution-oriented functional paradigm and a machine-oriented imperative paradigm? The compile-time code execution is cool, although I could see it getting seriously abused... but then you did say this language is for ninja coders only! It reminds me of the cool demos done when F# was launched. Regarding the example about compile-time checking of the map data, usually I believe this would be done by running unit tests, as it's better to separate code errors from data errors.

  • @nickcuthbert593
    @nickcuthbert593 9 ปีที่แล้ว +1

    Could that bug perhaps be because you're not flushing the print buffer with an EOF character?

  • @ElectronWranglerTV
    @ElectronWranglerTV 5 ปีที่แล้ว

    I agree with your comments about modern languages being dismal to use and feeling that your keystrokes don't count. I learned programming using MCS-80 assembly and continue to program primarily in all sorts of ASM including IA-32, x64, etc. Go ahead commenters, give me shit, I don't care. I actually enjoy programming in ASM and know each keystroke DOES count. I can fire up my IDE and be off writing working code. However, when I'm forced to fire up C++, Java, etc I have zero joy while programming. One thing that really resounded with me was when you said we need to get rid of all the GD header files. Having to deal with all the GD header files is one reason I prefer Java over C++. I shouldn't have to jump through a bunch of GD hoops and write a bunch of GD non-code to start writing working code.

    • @digitalspecter
      @digitalspecter 2 ปีที่แล้ว

      I wrote ASM for like 7 years too.. 5 years professionally. That was the time when I enjoyed programming the most .. but I don't know if it was the language or just me not being so cynical..

  • @plimsbury
    @plimsbury 9 ปีที่แล้ว

    Might the colon be used to assign both type and value?
    a : int;
    a : 5;
    b : int : 6;

  • @DreadKyller
    @DreadKyller 9 ปีที่แล้ว +1

    A thought about the semicolon discussion. The main (and only reason I can think of) to keep them is multi-line statements, which can allow for much easier readability, I replied to a comment with this same example:
    function1(function2(function3(function4(function5(2,function6(4))),4,function7()))
    That would be much simpler to visualize if it could span multiple lines and have indentation. Removing line terminators in favor of 1 statement per line is disturbing in that sense. This said, I'd be all for this idea of removing line terminators, granted there is a way to tell the compiler that the following code is a multi-line statement, as an example, obviously not a very precise example:
    .[here(
    is(
    a(),
    multi_line()),
    statement())
    ]
    Not sure is TH-cam will format that correctly, essentially anything between the .[ and the ] would be a multi-line statement instead of the statement being terminated by "
    "
    Something along the line of this.
    So my opinion, semicolons should be optional, but not required, they can be used to define multiple statements on one line, but do not need to be defined for single statements on a line. If a statement needs to expand multiple lines an optional syntax to tell the compiler to ignore all newline terminators until the next explicit terminator would be handy

    • @HiAdrian
      @HiAdrian 9 ปีที่แล้ว +1

      Personally, I'd rather the language specification was clear on this, with a specific line terminator either being required or forbidden. Packing several separate statements into one line is bad form anyway.
      I'm admittedly very used to the semi-colon though (since it's part of nearly all popular languages) and open to being persuaded away from it. To me a line looks unfinished without it, especially variable declarations, though Jonathan's colon syntax may make it more bearable.

  • @walter0bz
    @walter0bz 9 ปีที่แล้ว +1

    28:30 imo keep the loop as for.
    for ... in ... makes perfect sense
    principle of least surprise... its so common in languages. we've all been saying 'for' for so long already
    auto deref "." .. nice, works ok in go
    UFCS, if you have this i'm sold on this language.
    Dot a.foo(b) is about discoverability/IDE, and function chaining. a.foo(b).bar(c)...
    Agree OOP itself is BS. structs/functions are better.

    • @skepticmoderate5790
      @skepticmoderate5790 4 ปีที่แล้ว +1

      Just use pipes for function chaining. (x |> f : a -> (a -> b) -> b = f x).

  • @erlendheggen
    @erlendheggen 9 ปีที่แล้ว

    As the language continues to progress towards a usable state, are you planning to put it under an open source license and make it available via a public code repository?

  • @konstantingeist3587
    @konstantingeist3587 6 ปีที่แล้ว

    I'd think the main selling point of a "programming language for games" would be some sort of intrinsic support for actors (with realtime guarantees). Think of complex NPC-filled worlds (although simple arcades work as well). I.e. you define actors, behaviors, smartobjects, then you run it, and every actor's code is scheduled to run as green threads on one logic thread. Cooperation to be managed via message passing between actors, etc. This one looks like just another attempt to create C, with some personal preferences (I have no audio currently so I only skimmed through the screencast, so I may be wrong).

    • @jblow888
      @jblow888  6 ปีที่แล้ว

      "Actors" are library code, not language code.

    • @konstantingeist3587
      @konstantingeist3587 6 ปีที่แล้ว

      Built-in support for it would reduce the amount of boilerplate needed to work with the library (runtime). For example, every time you wanted to subscribe to an event in Java, you had to define a whole new class ("adapter"), with a lot of boilerplate code to glue it all together. No special language feature required, just a simple pattern, but it made Java too verbose and clunky. In C# (and in later Java) they introduced lambdas: the compiler now generates all that for you automatically, all you need is to write "x => x + 1". Same goes for async/await in C# (built ontop of Task Parallel Library). If there was no such language feature, you'd drown in callback hell. There are programming languages which support the actor model as a language feature, but as far as I know, they are oriented towards servers, not games, so they lack gamedev-oriented optimizations such as those in Jai.

    • @jblow888
      @jblow888  6 ปีที่แล้ว

      Okay wait, if by Actors you mean coroutines, that is definitely not going to be a language feature, sorry. That's not the kind of language this is.

    • @konstantingeist3587
      @konstantingeist3587 6 ปีที่แล้ว +1

      Yes, I see now that Jai is more low level. Maybe it's time for Jai++ :)

  • @syoxsk
    @syoxsk 9 ปีที่แล้ว

    So how about a Kickstarter? To give you the time and space, if you don't have them allready, to work on this as much as you like?

  • @Trunks7j
    @Trunks7j 8 ปีที่แล้ว

    While I appreciate the power and simplicity of defer, this seems potentially dangerous given that the programmer may need to correctly order their defer statements. At least in C++, the compiler guarantees that destructors for objects will be called in the reverse order they were constructed on the stack. Defer does not have this problem in Go since it's garbage collected.

  • @JebBradwell
    @JebBradwell 9 ปีที่แล้ว +1

    Another idea is to have what you have already for a programming language... setup so that individuals could customize the language design choices and options for their own use... This would be a harder project but might be something realistic down the road. I'm think have say a configuration file which allows users to change specific options about the language as they see fit... like where colons go and in what order things go etc...
    This would serve for more than just the purpose of allowing flexibility of the user to design their own custom language, but also might emerge a new idea of how improve upon the development of your current language by crow sourced permutational exploration of other users configurations.

  • @clumsyjester459
    @clumsyjester459 8 ปีที่แล้ว

    You agreed that we need a new OS. Any opinions on the approach of GNU Hurd?

  • @samuelgrahame3617
    @samuelgrahame3617 6 ปีที่แล้ว

    #run is awesome :)

  • @cthutu
    @cthutu 7 ปีที่แล้ว

    What was the name of the FFI library he mentioned? It sounded like "dine call" but I couldn't find anything on the internet with that name.

  • @jeffersoncarpenter2
    @jeffersoncarpenter2 9 ปีที่แล้ว +1

    The ability to run code at compile time, and have it churn out types for type checking, seems pretty trippy. And it kind of invites types to be first-class citizens of the language, like they are in dependently typed languages.
    Based on my own travels, it seems a lot of dependently-typed languages emphasize safety like Haskell does - you can never crash your compiler, or get stuck in a compile-time infinite loop, so to speak. That seems nice, but it's kinda complicated, and imo not practical yet. I'd rather play in a language where I can write rich and savory meta code, without getting cross examined by the compiler.

  • @Kavukamari
    @Kavukamari 6 ปีที่แล้ว

    what was that retro song he switched to for invaders eventually? some really old game I forgot the name of, but I wanted to hear the song again and couldn't find it

    • @Kavukamari
      @Kavukamari 6 ปีที่แล้ว

      nevermind, it was the Commando theme for the Commodore 64: th-cam.com/video/qrQuR1LHAVI/w-d-xo.html

  • @anishghosh316
    @anishghosh316 6 ปีที่แล้ว +1

    defer could be so useful

  • @_slier
    @_slier 3 ปีที่แล้ว

    This is like 6 years ago..When can we expect you to release it to public?

  • @smiley_1000
    @smiley_1000 4 ปีที่แล้ว +3

    I know this is insanely old, but I have a question: Isn't #run basically a "compile-time" JIT interpreter?

  • @paulfrischknecht3999
    @paulfrischknecht3999 9 ปีที่แล้ว +2

    How do you deal with the fact that from this point on, by "adding features" the language can only get bigger, i.e. (for many matters) more messy?

    • @angrydude8734
      @angrydude8734 8 ปีที่แล้ว +2

      +FichDichInDemArsch Are you suggesting we should use tools which invented by non-game-developers (the smaaaart google/mozilla/c++ committee people) to create our games, and dismissing tools invented by a successful experienced full-time game developer?
      HOHO, that stupid idea will make my day.

    • @togmeister8604
      @togmeister8604 8 ปีที่แล้ว

      +FichDichInDemArsch Oh yeah, C++ wasn't popular, and was actually hated for a few years after it was created. This language is not even three years old.

    • @jblow888
      @jblow888  8 ปีที่แล้ว +2

      +Phx Vyper (Loli Nekogirl) Please don't feed the trolls.

  • @catsby9051
    @catsby9051 ปีที่แล้ว +1

    So, you could make it so that your code doesn't even compile unless all of your automated tests pass? Gnarly.

  • @thomasjahn5594
    @thomasjahn5594 9 ปีที่แล้ว +7

    What Keyboard are you using? Typing on it just sounds great! *klick* *klick*

    • @mvandevander
      @mvandevander 9 ปีที่แล้ว +8

      It's a Leopold FC200r with Cherry MX Blues. It's unfortunately next to impossible to find nowadays, but it's very similar to a Filco Majestouch Tenkeyless version. (Not coincidental, as they were both designed by Carl Matsu)
      You can look at the Leopold here: deskthority.net/wiki/Leopold_FC200R
      And pick up the Filco here: www.amazon.com/gp/aw/d/B004WOF7QM

    • @FrankenPC
      @FrankenPC 9 ปีที่แล้ว

      Matthew VanDevander Along the slightly more expensive range is my Corsair K70 Cherry MX Brown keyboard. Less click. More dampening. I like it.

    • @seditt5146
      @seditt5146 4 ปีที่แล้ว +1

      @@mvandevander I got an old school IBM Model M here packed away. Talk about impossible to find lol. I was ready to toss the shit out until I found out how much people were paying for them which I find honestly insane.

  • @zydeas
    @zydeas 9 ปีที่แล้ว +3

    Where do I go to watch these? Are they live?

    • @AlexPolian
      @AlexPolian 9 ปีที่แล้ว +4

      They are streamed on Twitch. You can follow him here: www.twitch.tv/naysayer88

  • @ExCyberino
    @ExCyberino 5 หลายเดือนก่อน

    "I'll note make it public yet", Sure hope so one day kkkkkkkkk

  • @seditt5146
    @seditt5146 4 ปีที่แล้ว

    Automatic conversion eliminates optimization possibility so needing to cast is not that much friction and anything that explicit shows intent is an opportunity to speed up. Restrictions are opportunity. The Game industry is more than use to dealing with restrictions so it should not be to much issue and will allow SIMD operations for the compiler to dramatically speed up some instances. I say leave them and make people explicit case. It is not hard and can be extremely helpful.

  • @JebBradwell
    @JebBradwell 9 ปีที่แล้ว

    around 57:40 ish you talk about catching at compile time. I enjoy the mentality of keeping information as close to where it matters as possible. So taking inspiration from Bret Victor: vimeo.com/36579366 where you have your ascii_map() display the error message which you would get at compile time. But this would be worked in with the IDE which would work with your language.
    For looping and iterating you could allow for each loop to only be allowed to run for a certain amount of static iterations define right inside an IDE next to each for/while loop (to help prevent while(true) or while(1) or other looping situations where they loop infinitely at run time) each for/while loop would have a little toggle which would show the currently set max looping allowed as well as a button to increase that maxed allowed looping... i.e. lets say we have while(1). Then we would have a static max looping show up next to it of say 10... so that we don't get stuck on this loop for testing etc...
    I know this has many issues etc, but it's just another stab in the dark of one way we might bring information about errors or what we have forgotten to code closer to where we want it... and at worst we want it at run time, at better we want it at compile time, at best we want it right next to the piece of code we are currently looking at.

  • @togmeister8604
    @togmeister8604 8 ปีที่แล้ว

    Whilst it is great how much you have done you have accomplished you may want to note that if I've managed to work out correctly that your programming language gets turns into C++ or C or another language then it isn't a compiler. A compiler writes to assembly or machine code. A transpiler reads a language, converts it to another language and then uses a compiler to compile that language.

    • @localatticus4483
      @localatticus4483 8 ปีที่แล้ว

      +Togmeister | A lot of languages now use the `name : type = value` syntax, and honestly the `type name = value` syntax is something I'm not at all fond of. Just because it's something old that people are used to doesn't mean it's good.

  • @Girugi
    @Girugi 9 ปีที่แล้ว +1

    I would love the compile time stuff... I have been waiting for a C++ compiler to support const functions to be evaluated during compile time to do proper hash values for strings... we have a macro for that stuff right now, but the compiler don’t really see the results as const, so we can’t use them in switch statements or anything like that...
    As long as the language really provide the same control as C++, but also enable this compile time stuff, I would probably consider switching in the long run... but so far I'm a little worried that you will remove something from C++ that I like... we will have to wait and see :) I’m hopeful though! Except for some of the syntax that rubs me the wrong way, I really like what you have been doing so far, and I like that realizations you had when stating to use the language. Sounds healthy.

  • @UGPepe
    @UGPepe 9 ปีที่แล้ว

    if check_printf runs at compile time, how can it get argument_values?

    • @jblow888
      @jblow888  9 ปีที่แล้ว +4

      woodsmailbox1 Values are null for things that aren't known at compile time. I wouldn't worry about #check too much, since it is going to be superseded by something more powerful.

  • @m4rt_
    @m4rt_ ปีที่แล้ว

    1:13:27 "a source code release will come soon"
    ... It has been 7 years. (almost 8 years)