Already hyped for the implementation of floats so I can write a math library.
@Zwiebelgian2 жыл бұрын
@szylaz123 I don‘t want to modify the compiler which I assume I would have to. First of all I‘m not exactly qualified and second I think tsoding wants to do that himself
@rsa59912 жыл бұрын
6:30 Actually, it's addition, subtraction _and_ multiplication! The reason, why x86 has signed and unsigned multiply is because it's a double-width multiply: it produces a result with twice as many bits. However, the difference is always in the upper half (RDX) and in flags, while lower half (RAX) is the same for both! So, as long as you are doing a single-width multiply, you can use either!
@ribosomerocker2 жыл бұрын
32:20 This fundamental issue has already been solved by languages like Joy and Factor! Check the documentation (mainly the files in Joy), but it is not an unfixable issue within concatenative languages. Specifically, the recursion functions in Joy do it very well. Cheers! EDIT: not quite! It's not really solving it, rather than some weird workaround. Check the replies
@frechjo2 жыл бұрын
In the Factor listener: : foo ( a b -- c ) drop ; : bar ( a b c -- d ) drop nip ; : baz ( -- e ) 1 2 3 foo 4 bar ; baz . => 2 : foo ( a b c -- d ) drop nip ; => error: baz: stack effect declaration is wrong. That's what he's complaining about. He wants it to say the error is in foo, not in baz. I don't see how that would be possible. I also don't see how that's essentially different from saying the error is in passing the wrong number of arguments, when you could have meant to use a different function: determinging what's the actual error and its solution is intractable in the general case. It only seems obvious for given specific situations.
@ribosomerocker2 жыл бұрын
Essentially, what Joy does and I know fixes this, is called quoting, or using lists. Essentially, if you do use lists, you are able to simulate "scopes" in joy, which I would imagine solves this issue. for an example; ``5 [2 3 +] i *.` ` would return ``25``, if you remove the 2 or 5 here, you would be told correctly what your issue would be if you remove one or the other. Joy also has a lot of useful functions to do things in ways like this and it genuinely works very well.
@frechjo2 жыл бұрын
@@ribosomerocker Ah, now I know what you were referring to. In Factor that is ``` 5 [ 2 3 + ] call * . ```. I don't think that works. [ 3 + ] is actually a valid quotation: if you remove the 2 and it complains about it, it's doing the wrong thing. Besides, I can't see how that's a solution: you'd have to either put every word in a quotation, together with its arguments (and why are you even using this language by then?), or you need to know which ones to put in quotations, which also makes the whole thing irrelevant by then. To catch that "error" in Factor would require something like ``` [ 2 3 + ] call( -- n ) ```, but that's just awful (do that every time you call a word). I don't know of anything like that in Joy. Maybe Kitten or Cat would do better than Factor (and Joy), but I don't see it being much better. Actually, the only reasonable solution would be doing it like Pop11: alternative syntax for calling words like +( 2 3 ) (which you can check). But that's no longer concatenative.
@ribosomerocker2 жыл бұрын
@@frechjo You're right! In my head, I thought something like that would work, but it seems it wasn't quite it, oh well. Thank you so much for correcting me! I'll edit my comment to correct it
@Protoex2 жыл бұрын
I disagree on this statement of porth not having negative numbers, because it kind of have the structure. I would say it doesn't have negative number LITERALS. But I'm probably being pedantic.
@lorg0n2 жыл бұрын
Very legible speech, thank you.
@diegorocha21862 жыл бұрын
Zozin is not thread safe 41:49
@albinekb10 ай бұрын
Your'e great, never change pplease! Thanks!
@encody2 жыл бұрын
I have never heard of porth before but this is so interesting. I'm not familiar with "concatenative programming" but it looks very clean and I like it. I'm sad I can't dedicate enough time to watch all of the stream recordings!
@TsodingDaily2 жыл бұрын
You never heard of it because this language does not exist :)
@icebox2462 жыл бұрын
maybe the argument count changing for refactoring can be fixed by introducing an optional token, if it gets encountered in typechecking while going back in the stack to check arguments throows an error eg d $ b c bar c foo and if you change bar to accept 3 aguments when typechecking will find $ token and throw an error, maybe this token can have more uses for such cases when you need to mark an end of range when searching the stack backwards
@DanDeCapria2 жыл бұрын
Can we not just optionally include explicit user-defined RPN scoping on the implementation/usage of the proc, and compare that to its contract at compile time? $ foo(a,x,d) # simple example d x a foo # no problem $ foo(a,bar(b,c),d) # DFSA based target example d ) c b ( bar a foo # ! min explicit contract scoping d c b bar a foo # compared to RPN ambiguity in bar|foo ) d ) c b ( bar a ( foo # overkill explicit contract scoping, same effect Here's a possible way to render user-defined contract scoping on failures when proc modified: $ bar(b,c) -> bar(b,c,y) ) d ) c b ( bar a ( foo ^~~~~ `bar` procedure expects argument `y` # RPN takes this into account in implemented order precedence already (implied): $ 9 / 3 * (1 + 2) # = 9 ) 2 1 + ( 9 3 / * # = 9 2 1 + 9 3 / * # = 9 $ 9 / (3 * 1) + 2 # = 5 9 ) 1 3 * ( / 2 + # = 5 9 1 3 * / 2 + # = 5 And we just optionally explicitly extend this into procedures. Thoughts?
@icebox2462 жыл бұрын
@@DanDeCapria I think that the "(" token isnt needed since calling a function implicitely closes a list of args, but thats just syntax.
@kedusyared65892 жыл бұрын
amazing thumbnail. very complex and deep.
@lucasa87102 жыл бұрын
Just doing a "Brainstorming" about this problem 33:12 I don't know if it would be implementable, but my idea is to create a new operation that inserts a "mark" into the stack indicating that an argument list is about to start, then whenever you call a procedure it keeps poping the arguments until the mark, skips the mark and continues example: args-init d args-init c b bar a foo in the example call bar would give an error because bar expects 3 args but reached args-init before getting 3 args you can think of args-init being a ")" anyway... I have no experience with concatenative languages
@dwightk.schrute86962 жыл бұрын
Any plans to make the language porthable to other important platforms like s390x?
@davidoiltonante88752 жыл бұрын
just yesterday i was thinking you have never used negative numbers and what porth would do in case you try one
@minamagdy41262 жыл бұрын
58:00 Having been part of the discussions on extensions of the let bindings, I can assure you most of us were completely for leaving procs as is. Some simply thought that, as syntactic sugar, the bikeshedder operator could be used to help better define the let bindings in ways that may not even need a let-peek distinction or a necessity of the word 'in' for every situation (that last one was my contribution). It would be cool to have some adjoining of let and proc as keywords in some dual functionality way, though, mostly as future syntax for lambda expressions or generic-typed functions, although the second point may not be what is desired. That said, most of us understand the semantical distinction between let bindings and procs just fine, without requiring any changes to the latter for now.
@shloh5322 жыл бұрын
Could you share your emacs configs?
@titouant19362 жыл бұрын
For your change in arity issue you could either add a last argument marker, ie a "." or a ";" or add an arity marker like "d b c bar/2 a foo/3" which makes you explicitly tell how much data is expected to be consumed. Both of those would break the whole codebase though, they could be made optional but then they would most probably not be used when you need them. An other solution would be for the compiler to report all consuming tokens in range of the proc that lacks data as potential over consumers. A related problem would be when a proc returns additional elements with the new definition, in this case I think it would be nice for the compiler/runtime error to report the origin of that element in the code (who put it there?) Instead of only the proc (I think that's how it is now). I kind of like the arity marker approach because it could solve both issues at once, and could allow multiple definition with the same name but different arities. On the other hand the last argument marker could be used for function with arbitrary number of arguments.
@sodiboo2 жыл бұрын
40:48 Other than using whitespace to separate tokens (i.e. "- 0" vs "-0") and inside string literals, does it matter what kind of whitespace and how much you use? Can you use a newline or a space at any point and expect the exact same compiler output? For example C# has blocks defined by curly braces (and porth seemingly by keywords) but Python requires a specific indent, and if you have a different indent level or with different whitespace, the behaviour of the program can/will change and it could fail to compile just from that change. Is porth like that, or does it not care?
@TsodingDaily2 жыл бұрын
The indentation does not affect the behavior of the program. The blocks are defined by keywords. Newlines are treated as spaces.
@itallstartedwhen2 жыл бұрын
Does anyone know how is -1, stored in memory, in terms of bits ?
I know "neg 1 plus" works too negate a number, but I like "0 over -" more
@luandkg2 жыл бұрын
Could have assert command in porth like : assert "One + One = Two" 1 1 + 2 =
@CD4017BE2 жыл бұрын
The language uses reverse polish notation, so it would be `1 1 + 2 = "One + One = Two" assert` instead. And then you could just define the `assert` function yourself.
@codeplay49472 жыл бұрын
How did you learn c
@CYDAmity2 жыл бұрын
17:49 OMEGALUL
@Ari-ez1vj2 жыл бұрын
just adding more bloat we don't need negative numbers
@akkudakkupl2 жыл бұрын
Now think about ones complement where you had positive and negative zero. Twos complement must have felt like a godsend.
@hanqnero2 жыл бұрын
That C moment when you need to use pointers and links to convert a number.
@wChris_2 жыл бұрын
converting unsigned to signed is Undefined behavior in C (especially converting an unsigned number with the highest bit set!)
@skybuck20002 жыл бұрын
Which editor is this ?
@Orincaby2 жыл бұрын
gvim
@skybuck20002 жыл бұрын
@@Orincaby Hmm interesting... do you use it for git commit messages, or you don't use git ? How much better is this than just the standard editor that comes with git ? hmmm....
@vladlu63622 жыл бұрын
@@Orincaby pretty sure this is EMACS
@Andrath2 жыл бұрын
Looks like you need an assert keyword
@gligoradrian7842 жыл бұрын
The „whole” time.
@va9if2 жыл бұрын
18:47 got offended >:(
@manuillo942 жыл бұрын
Hey I can't what your videos because I have misophonia. You are obviously in no obligation of pleasing me or my kind, although in case you wanted to, consider investing in a pop filter and/or filter out high frequency sounds.
@TsodingDaily2 жыл бұрын
I'm extremely sorry for my sound quality. I'll try to do what I can but can't promise anything.
@technologicalwaste76122 жыл бұрын
IMO Both signed integers and floats are code smells.
@----__---2 жыл бұрын
damn he really kept the nodejs note in the description. cant blame though, everyone knows javascripters are dumb lol
@kadensharpin21562 жыл бұрын
I mean you are forced into using JS on the web
@narkocat2 жыл бұрын
Idk, did not like that flame from him, was a bit weird. It's not like the guy said anything bad to him.