- 103
- 26 125
tangentstream
United States
Приєднався 5 жов 2021
This is my secondary channel for unedited recordings of my livecoding streams. They are all programming-related and often use unusual programming languages like J or K. I tend to record at least an hour a day on weekdays, and whenever time permits on the weekends.
If you'd prefer shorter, more polished videos, check out my main channel at /c/tangentstorm instead.
If you'd prefer shorter, more polished videos, check out my main channel at /c/tangentstorm instead.
b4 vm demos in decker
b4 is a virtual machine I'm working on for an upcoming programming course.
The decker implementation has a really nice moldable development environment, which I''m showing off here.
0:00 tour of the ui
03:09 bytecode
06:48 start of demo
09:23 the terminal contraption
10:02 more examples
15:18 alphabet demo
18:21 color text demo
19:52 hex writer and disassembler
22:52 editor demo
The decker implementation has a really nice moldable development environment, which I''m showing off here.
0:00 tour of the ui
03:09 bytecode
06:48 start of demo
09:23 the terminal contraption
10:02 more examples
15:18 alphabet demo
18:21 color text demo
19:52 hex writer and disassembler
22:52 editor demo
Переглядів: 138
Відео
Roassal3 for GToolkit: Pair Programming with Oscar Nierstrasz
Переглядів 168Рік тому
Roassal3 for GToolkit: Pair Programming with Oscar Nierstrasz
OrgPrez #2: Implementing "Click to Edit"
Переглядів 116Рік тому
OrgPrez #2: Implementing "Click to Edit"
#19 : fixing history - the ridiculously early j morning show
Переглядів 413 роки тому
#19 : fixing history - the ridiculously early j morning show
this video was just the thing I was looking for🥹
interesting to see how induction on infinity is done, it reminds me of regressus ad infinitum
its like a science fiction movie. I have no idea what u doing there . l m trying to learn gd script and I ve seen your chess tutorial then lm here ..which level of programing is that ?
I don't know. There's no levels. just focus on working toward your goals and eventually it'll work out.
I'm at 1:22:59: Where you had the viewmat colors. You can see three pair of dark blues diagonally together and two single dark blues that look random. Not coincidence. The diagonal pairs are the relative twins, and the single blues are the ones that were next to "scratched off" ones. You're getting there. Remember the finger counting along the rows thing? Before eliminating the multiples of three? That's where you can easily mark the multiples of the 5s and 7s that you're going to scratch off later are easiest to see. Then just before you eliminate the multiples of 5 is where it's easiest to mark off the multiples of 7 11 13 17 19 23 29 and 31. Or, you do the next best thing which is the prime wheel, so that you can just skip them from the algebraic formula of the sequences without having to mark them off. But in this algorithm, marking them off is the easiest way to avoid the division guesswork.
Oh I see, so just run a mini sieve of Eratosthenes on all the numbers you generate at each step. Interesting. I suppose that could be passed off to a traditional bitvector implementation if you generate the wheels on the fly... I think after I finish the proof video, I'm going to have to make a part 2 of my presentation about making this thing fast.
@@tangentstream I would describe what you're saying differently, but I think it's the same. You have the main sieve process already set up. At each iteration, though there's a series of secondary sub-processes that take place, one for each new seed. So, at the prime=3 iteration, there will be 2 sub-processes, one for the 5-seed and one for the 7-seed. You do the counting of every 5 (starting from the 5) and of every 7 (starting from the 7) *before* taking the multiples of 3 out to get the multiples of those two that will show up in the future iterations. When you do that, you'll mark the 25, for example. Once you start iteration for prime=5, you'll look for your marked number 25 in the new seeds that just got generated and eliminate it when you eliminate 5.
I don't think about it as removing any numbers. I know that's an anti-concept in the context of sieves but... You start with a single arithmetic sequence that represents all integers greater than or equal to 2. The algorithm simply reshapes that arithmetic sequence into two arithmetic sequences, one of which is all multiples of 2, the other is all the numbers relatively prime to 2. So, taking the series of numbers that are relatively prime to 2, the algorithm reshapes them into 3 arithmetic sequences, one of which is all remaining multiples of 3, the other two sequences are all the numbers relative to 2 and 3. And so on. But no numbers are being eliminated; they're just in another bucket. You can still add up the different arithmetic series from both buckets to produce all integers greater than 1. No numbers are being generated, either. Each arithmetic series is only being separated into sub arithmetic sequences that add up to it, and some get moved over to the other bucket. The sum of all the series in the two buckets is always the set of integers greater than 1. The basic premise of the algorithm is that one bucket always has arithmetic series representing all relative primes in it, and the other has arithmetic series representing all multiples of primes in the other, as it finds primes one at a time.
That's interesting. I'm not sure that's how I understood it when you first showed me the idea. I'm pretty sure there's a variation of this algorithm that uses a single mutable array (and maybe a stack?) to generate only prime numbers on the fly, where nothing (or maybe almost nothing?) gets removed. This fits with what you're saying but I'm not sure we're talking about the same idea.
@@tangentstream Actually, yes. The original J version used i. and $ , instead of calculations. As I told you early on, it was a multidimensional array growing a new dimension with every iteration. But I found that no one would understand it, or listen long enough to understand my explanation. So I "translated" the arrays to arithmetic series. As a prime generator, however, one doesn't really want to see the relative primes, but, really, the crux of the algorithm is separating primes and their multiples from relative primes and their multiples. It's just two sets of numbers that can always be represented by an ever growing list of arithmetic series, but really are a reshaping of the number line .
tough session. deep breaths. "proofing is like a maze..."
Yeah. I kinda knew it was going to be rough from the start, but I was still optimistic then. :) I'm going the other route tonight.
What you learned doing this, regardless of whether it helps with the other parts , will speed up anything else you attempt to do. The rate at which you're getting things done now and knowing what to expect from the system is blinding at some points now.
Ouch, the attempts following 1:27:20 were painful to watch. Syntax fits on a postcard. Three levels of precedence. Still not simple enough for some. 1:30:03 -- oooh, your example used readStreamDo: (a keyword message, last precedence, doesn't need the parens). The problem was that unary messages (such as readStream) take precence before binary (symbols) - or keyword -messages, so you were sending readStream to the "test.dot" string, not the result of (Filesystem / '...' / '...') chain. 1:31:30, and you found a work-around, but not the source of your problems 😞 Saaaad.
First of all can you just get to the point, second how are we supposed to contribute when all your names are m,q,n,ks,d etc..
We're learning with you. And the progress is clear to see. Thank you!
Well, I definitely appreciate the encouragement! :)
Congratulations! That was awesome work! Your persistence in your ever-advancing trial-and-error in reaching your goal is a testament to the trust in your gut of knowing your goal is correct. A lesson for all. I think we all learned more from that one omission of q than we would have from having included it. So, I wish you hadn't forgotten to include it, but I'm also glad you did. Regardless, valuable material here. My learning of Lean will be much faster thanks to your streams. Thank you. I should also mention, I love when you ramble; don't stop doing it. :)
Great job with the proofing. There was a moment that you seem to have flipped a switch and gotten on a roll. I think what you're trying to describe with your Queue is the Just-In-Time calculations. That is, changing the algorithm to calculate the seeds only when they're needed instead of in batch form. As to the twin prime conjecture, you might want to think of it this way: You already know that all possible primes will always be found along the lines of your rake lines, at any iteration. The further along you generate primes, the more rake lines you have, but the narrower your search space for future primes, by 1/p to be exact. You also already know that all your rake lines are parallel to each other, at any iteration. That means that all twin primes no matter how large *must* be somewhere along two rake lines that started out with seeds that had a gap of 2. And, because they are prime and because the sieve works, they will soon enough become seeds of the sieve, generating even more seeds with gaps of 2. All that would be left to prove is that along the rake lines with a gap of 2 there will always be twin primes simply because they each contain infinite primes. I think it's odder to think that the twin primes will somehow avoid each other. :)
Yes, I do feel like I'm "getting the hang of" lean a bit more now. I don't have to stop and hunt for things so often any more. As for the twin prime conjecture. I think everyone expects it to be true. So yes, it seems unlikely that you'd run out of pairs of sequences separated by two, or that the paired sequences would settle into a pattern where the primes never again coincide... But "seems unlikely" isn't a proof. You have to actually demonstrate why it can't happen, otherwise you're just restating the original conjecture in a new way.
This particular sieve is not just a prime sieve because it's not sieving just primes; it's sieving whole arithmetic sequences that have primes as their starting value. Yet, in doing so, it's generating new arithmetic sequences for later sieving.
Yeah. There's no guarantee the starting values are prime, but at any given time the smallest constant term (c) and all the other constant terms up to c^2 are prime. If have time I might try to defer the calculations past c^2 since the current implementation is incredibly slow.
@@tangentstream yes, not "primes as their starting values", rather "relative primes as their starting values". Rather than Infinite Prime Sieve, maybe Infinite Relative Prime Generator.
The number of seeds grows as a function of the current prime multiplied by the number of previous seeds minus the number of seeds that are multiples of the current prime which get eliminated.
In chatGPT try prompts like: "I'm looking for a summary of the keyword "show" in Lean 4, but the documentation I have found in their website is seems to be sprinkled in parts in several places. Could you give one comprehensive summary of the syntax and use of that keyword in Lean 4?"
I see what you're doing here is creating a proof for the general properties of sieves, and then proving that this specific sieve meets the sieve properties, so its results must be primes. I like this method because the first part can be used for any sieve, not just this one, and, with a few tweaks, you'll also be able to use it for other things that are not sieves. So, the proof of the first part becomes even more important than the proof of this specific sieve. Cool!
Yeah. I wanted something general that wasn't too tied to a specific implementation, in hopes that I'd be able to change the implementation later. I was also doing it that way just because it wasn't obvious what the exact statements I wanted to prove were.
Please, give the 2nd part, what to do next?
I got to.... make 2D before I had to check youtube. I'm a bit more confused now but I don't blame you. lmao.
I just got PTSD when godot 4 just released, some time ago. Thanks for the Video tangentstream! I never played with UI component as much, with this might align the chessboard universally, that is to say.
great tutorial
keep it bro
I really like that you don't cut out your actual process while working on this, I end up feeling stupid when I watch extremely well prepared / choreagraphed and edited tutorials, and I lose a lot of quality information on how to actually solve problems
haha I think he was just lazy. I prefer "choreographed" videos. They are half as long and actually get to business rather than wasting your time :-D
how to become as good as you
Well, while I appreciate the implied compliment, it's no good trying to compare yourself to other people. I don't know where you're at in your journey, but in general you get better by practicing and being willing to work a little outside our comfort zone. Like in the server for rogo, I picked htmx - a fairly new web framework I knew very little about. That's probably going to introduce some confusion and missteps along the way, but I try to go in knowing it's going to be a little painful and just trust that it'll all work out if I push through it long enough.
Although I'm using a completely different framework and work plan, i've decided to watch this project completely, i think i'll learn a lot from a professional like yourself, so keep going and thank you...
Well, awesome. :) Makes me feel a little guilty for not editing out all my screwups. :D BTW, I've set up a discord server if you want to ask questions when I'm not online here. See tangentcode.com/community.html
@@tangentstream That's when i learn the most lol And yeah I'll check it out for sure
3:10 now that you mention it, the !: functions in J reminds me of calling BIOS/XBIOS/GEMDOS functions back when I was playing with 68000 assembly language on the Atari ST: the "groups" were interrupt numbers (called with the "trap" instruction) and the individual functions were opcode numbers you'd push onto the stack (after any other params) before calling it. So to write a character to the screen you might use "bconout", opcode #3 on trap #13 (BIOS). I always found the !: part of J's stdlib really ugly and awkward though; I prefer the K way of doing those things, although I'm not an expert on either.
My brain can't help but read that as "b-coconut". :) Meanwhile, I don't know any way to DM you on here, but (regarding our discussion on stream earlier): tangentcode.com/community.html
What is it. I am kind of a beginner.
It's a virtual machine. Basically simulating a tiny computer. Hopefully, it'll make more sense when I'm done. These livecoding streams are basically me working on something I'm developing behind the scenes for a nice polished presentation on my main channel.
Regarding your comments at 8:40, I would describe K dictionaries as a list of triplets (key [symbol];value [any];attributes [null or dictionary]) that are addressed by the 1st element of the triplet instead of a numeric index. The attributes don't really have much "magic", they are just a dictionary for storing metadata. The "magic" that you may have been thinking about is that in the K tree some attributes have special meanings (e.g., triggers or dependencies), but that is a characteristic of a specific dictionary (the K tree), not of dictionaries in general. globaltrig:.,(`foo;1;.,(`t;"`0:\"globaltrig invoked \"")) globaltrig[`foo]:7 globaltrig invoked globaltrig[`foo] 7 (the variable is global, therefore it is in the K tree, the t attribute has a special meaning of "trigger", execution of the attribute is triggered whenever globaltrig's value changes, and a message is shown) but, testlocal:{localtrig:.,(`bar;1;.,(`t;"`0:\"localtrig invoked \""));localtrig[`bar]+:x;`0:,$localtrig[`bar]} testlocal[8] 9 (the variable is local and not in the k tree, therefore t is a simple attribute, it does not have the special meaning of "trigger" and no message is shown)
Good point. The magic is in the k tree, not dictionaries in general.
bro you are a fkn genius! jeez! I feel so incompetent lol
Well... that's not exactly the reaction I'm shooting for, but thank you. :)
So i guess nothing yet. You are talented but you do a whole lot of diff stuff simultaneously
Yeah. I got really stuck because I kept wanting to make animations that I didn't know how to make in the animation tools I used before. Hence the smalltalk drawing and animation stuff. Once I have that working I plan to make a lot more scripted and edited videos. (And you're absolutely right about doing too much at once. Despite appearances, I have been making a much bigger effort to stick to one thing at a time the past few months)
bro you are a genius!! Its all Im saying bro. Im glad you responded. That was kind! <3@@tangentstream to be honest i would love to do a video with u
Part 2 plz?😊
YES PLEASE
Is there a course on Pharo that is truly made for people that have not programmed before? After finishing that what about project based courses that teach how to reach a "enterprise" level of programming skill all implemented in Pharo that can make you hireable in the companies that use Smalltalk? If no new people are onboarded into communities like Pharo, APL, J, Raku etc and they expect only already existing programmers to migrate they are loosing a huge amount of potential programmers that can continue driving forward these super super small communities. Already existing programmers will EASILY leave Pharo or any of the other more less known and used languages as soon as some problem can be solved with some existing library in a much huger ecosystem but true beginners that became programmers by using Pharo or another of the more obscure languages might actually stick with their "first love" more and help create libraries for niche domains and niche use cases.
I have been trying to write very basic eda tools in Godot! Can you put a link down to the talk with Tudor in the description? I've spent some time with Pharo too but i decided against it. This is super interesting I cant wait to see more!
Thanks! The talk with Tudor Girba of feenk is here: ua-cam.com/video/FJP2zkl_44o/v-deo.html
It turns out the "echo" in the clips is not in the clips themselves but a bug in the player component. So: this idea should work just fine if I can locate and drop in a replacement.
Of course I don't actually have time to record any work on this, but... I at least got to explain the idea. :/
Thanks for making a GT series... any chance you would make a video on trying to animate from a sprite sheet?
Sure. You want to join me for some pair programming?
Hey, thanks a lot for posting this, past me! I know you got interrupted at the end, but next time be sure to check your code into git before you just run off and delete your image to reinstall GT. I made that mistake, but thanks to this video I was able to recreate the animation! :D
It comes back to compose-ability vs walled gardens.
maybe learn editing next
Thanks, bro! I give it a shot.
@@tangentstream plz, give the 2nd part, and also add the online maltiplayer mode
I would say that 2^903 is a "little bit" bigger then "astronomically large" considering amount of atoms in the observable universe ;)
Fair enough! :)
Have you thought about making it in J? There is a J web server as far as I know.
Nope. There's no reason in principle that a UI system like this couldn't be done in J, but right now, Pharo (and glamorous toolkit in particular) seems to be way ahead of the curve in terms of making desktop UI easier. The other serious contenders for me would be tauri/electron (desktop html), Lazarus for free pascal, or flutter... But overall I'm really liking working with Pharo.
Huh. I guess I don't have this saving the chat? :/ UA-cam cut me off in the middle of a sentence because the stream was over. I'm guessing the same happened to everyone. Nice talking to you guys! Will try to fix that for next time.
Thank you for streaming and recording these videos. There's quite some material on Smalltalk on youtube, but most of the times it's very short introductory videos or just minimal demos; I really appreciate in this case I can instead have an idea of "what it feels like" to develop in Smalltalk/Pharo/GToolkit
awesome. I'm glad someone's getting value out of them!
At 13:12, I had a moment there because the last node is labeled 30, instead of 31 = 2^5-1. Of course, there still are 31 nodes, but the zero-indexing threw me off, haha!
lol. yes i get off-by-one errors every time i mess with this data structure, no matter what base i'm using. :D
worst tutorial for making a chessboard ever, he coded a checkbox to change a colour???? wtf???
and like he used it manually still...
godot fever dream
Tutorial is very nice but the "cuts" are so robotic lol, it's distracting at some point
what
oh damn oh damn oh damn ....new J movie :D :D :D Best present for Christmas!
The finished "dealing cards in J" video is here: ua-cam.com/video/eXGKK8BkCkg/v-deo.html
Usually I have Descript edit out all the "ums" and long pauses. That might have saved 30 minutes here, but it also makes the video really choppy and I don't have time to go restore all the places it cuts out something important. I'd rather save my editing effort for the scripted videos on my main channel, so it's either automated cuts or nothing. If you're watching these videos, what do you think works better?