« first day (4101 days earlier)      last day (1072 days later) » 

00:04
posted on January 07, 2022 by Cole Brown

The Stable channel is being updated to 97.0.4692.77 (Platform version: 14324.62.0) for most Chrome OS devices. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels Find out how. You can submit feedback using ‘Report an issue...’ in the Chrome menu (3 vertical dots in the upper right corner of the browser).  Cole B

00:58
@VLAZ that is sad
01:27
Spent all afternoon debugging this stupid little buffer thing for my lexer... and it finally works
	buffer() {
		for (var t = 0; t < this.tokens.length; ++t) {
			let curTkn = this.tokens[t];
			let preTkn = this.tokens[t - 1];
			if (preTkn) {
				if (curTkn.type === preTkn.type) {
					if (this.tokens[t - 1]) {
						this.tokens[t - 1].mergeFrom(curTkn);
						this.tokens.splice(t, 1);
						t--;
					}
				}
			}
		}
		return this;
	}
turns out the key was t--;
Ive never thought of manipulating the index during the loop
but that was the trick
what a day..
im tired now
01:53
@MisterSirCode ew
tabs
 
2 hours later…
03:56
Hello
@MichaelMaust Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
Does anyone have experience with syntax highlighters for styling <code> blocks with React components?
 
2 hours later…
05:34
566
Q: Looping through array and removing items, without breaking for loop

dzmI have the following for loop, and when I use splice() to remove an item, I then get that 'seconds' is undefined. I could check if it's undefined, but I feel there's probably a more elegant way to do this. The desire is to simply delete an item and keep on going. for (i = 0, len = Auction.au...

You can also loop in reverse from length to 0 - then you don't need to manipulate the index.
 
7 hours later…
12:59
@JBis whats wrong with tabs?
They look a lot cleaner in my editors
this chat just has terrible formatting
I mean we have had formatting in this chat for like over half a decade and we still cant use formatting with multiple lines??
oh yeah TIL that .some always returns false if the function returns nothing... aint that great?
	isFunction(tkn) {
		return Object.keys(this.functs).some((v) => {return v == tkn.value});
	}
Soooooo Great >:/
Anywho, I now have a fully functioning tokenizer
@MisterSirCode nothing is the value undefined. And the value undefined is falsy. The return value of the function is always converted to a boolean.
@VLAZ ah that makes more sense
I always forget about javascript's falsy behavior
ugh... now I have to write a compiler
		let curParent = 0;
		let lookingForCloser = false;
		let codeInParent = [];
		for (var t = 0; t < tkns.length; ++t) {
			let curToken = tkns[t];
			if (curToken.type = "left-parenthesis") {
				curParent = curToken;
				lookingForCloser = true;
			}
			if (curParent != 0 && lookingForCloser) {

			}
		}
this is going to be painful
I dont even really know what to do, so Im kindof just trying one idea and hoping itll work
14:00
@MisterSirCode Compiler for?
@VLAZ Im writing a basic language
Mainly I just want to get math and parenthesis trees working
then Ill support functions / constants / variables
Its... WIP right now, Im currently writing the parts of the compiler that recognize the operators
May 14 '20 at 20:57, by VLAZ
here is a good one. That's a full parser, so it goes through tokenization + AST/RPL building but you're interested in the consumption steps later on.
^ might be an useful resource.
I remember that
but I wanted to try writing one completely on my own
I did the tokenizer and buffer on my own
Most of this is even possible because I just have more experience now than I did a year or two ago
Ive gotten it to a point where it can see operators and values next to / ahead of itself
so it can even send errors at which specific point in compilation, and even give the token ID
said token ID can then be backtracked to the line and character position, explaining exactly what the issue is
Im pretty sure itll work
now I just need to finish writing it and prove it
14:20
Getting there... slowly..
if (curToken.value == '*') {
    registers[t].value = `${parseFloat(regs[0]) * parseFloat(regs[1])}`;
    registers[t].type = 'literal';
    registers[t].compiled = true;
    registers.splice(t - 1, 0);
    registers.splice(t, 0); // Array was edited, assume changes
    t -= 2;
}
oh god
there we go, fixed it
15:02
its somewhat working now
it successfully multiplied numbers :3
now to add the rest of the math functions
its very NOT finished tho lol
let teststr = "5 + 5 * 5";
this turns into
Compilation finished with value 5 + 25
lol
15:18
o/
Happy New Year
@BeerusDev How about..... Not-So-Happy-But-Please-God-Make-This-A-Better New Year
I agree
@MisterSirCode Since you ask nicely, I'll think about it.
Ask JamesBot
15:28
|| heaven or hell
hell
@VLAZ hi god, hows it goin
@MisterSirCode If I have to be honest, I feel like I'm not really fit for this "god" business. Seems like I could have managed things better.
Anyone know if there is a way to handle overflow y scroll speed?
@VLAZ ;3
@BeerusDev Use velocity instead of static speed (A dynamic number that is added to the speed, which is calculated / added / multiplied into the position), then use a min/max clamp function for the velocity and actual position
and then just add a really basic friction multiplier
if you want to get really fancy, you can even calculate a "bounce"
but thatd be pretty dumb for a scrollbar
but yeah, most of the vector stuff is basic math you can find on google
its honestly surprising javascript has absolutely no vector implementations or even clamp features, even though its really easy to add
15:40
@JBis really wish y'all beat Georgia
 
1 hour later…
17:07
Does anyone have any good recommendations for certifications pertaining to JS
@MisterSirCode a coding angle dies every time you hit tab
@BeerusDev me too, but we had a good season. Now we need Georgia to beat bama'.
No we do not
the Tide is going to Roll

« first day (4101 days earlier)      last day (1072 days later) »