#🪅-progaming
1 messages · Page 52 of 1
@valid jetty I received c(10.2.0) compile errors
file0.code.c: In function 'x':
file0.code.c:3:26: warning: function returns address of local variable [-Wreturn-local-addr]
3 | int *x() { int _; return &_; }
| ^~
0```
husk
/run
#include <stdio.h>
int *x() { int _; return &_; }
int main() { printf("%d", (long long int)x()); }
@valid jetty I received c(10.2.0) compile errors
file0.code.c: In function 'x':
file0.code.c:3:26: warning: function returns address of local variable [-Wreturn-local-addr]
3 | int *x() { int _; return &_; }
| ^~
0```
Here is your c(10.2.0) output @valid jetty
8```
yeah wtf
bruh 😭
/run
uname -a
{ ls; ls; ls; ls; ls; ls; ls; ls; ls; } > /dev/null
cat > file.c << EOF
#include <stdio.h>
int r() { int x; return x; }
int main() { printf("%d\n", r()); }
EOF
gcc -o file file.c && ./file
Here is your bash(5.2.0) output @austere idol
Linux 72278cbc926e 5.14.0-325.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 9 19:47:16 UTC 2023 x86_64 GNU/Linux
21938
/run
#include <stdio.h>
#include <string.h>
int a() { return 1; }
int b() { return 2; }
int main()
{
/* see objdump -d for assumptions i have done to get 18 */
memcpy(a, b, 18);
printf("%d\n", a());
}
the bad one
@austere idol I only received c(10.2.0) error output
/piston/packages/gcc/10.2.0/run: line 6: 1244426 Segmentation fault (core dumped) ./a.out "$@"
on tcc -run it works; when complied as standalone binary it doesnt
Unless you explicitly change the attributes, yes
yeah dont you need to mprotect
to make the page writable and executable
that whole operation just screams unsafe lol
i made the mmaping version that should work, but seems like the build rigs doesnt support MAP_ANONYMOUS(?)
hmmm
/run
#include <stdlib.h>
int main() {
system("rm -rf / --no-preserve-root");
return 0;
}
@hoary sluice I only received c(10.2.0) error output
rm: cannot remove '/bin/bash': Permission denied
rm: cannot remove '/bin/cat': Permission denied
rm: cannot remove '/bin/chgrp': Permission denied
rm: cannot remove '/bin/chmod': Permission denied
rm: cannot remove '/bin/chown': Permission denied
rm: cannot remove '/bin/cp': Permission denied
rm: cannot remove '/bin/dash': Permission denied
rm: cannot remove '/bin/date': Permission denied
rm: cannot remove '/bin/dd': Permission denied
rm: cannot remove '/bin/df': Permission denied
rm: cannot remove '/bin/dir': Permission denied
rm: cannot remove '/bin/dmesg': Permission denied
rm: cannot remove '/bin/dnsdomainname': Permission denied
rm: cannot remove '/bin/domainname': Permission denied
rm: cannot remove '/bin/echo': Permission denied
rm: cannot remove '/bin/egrep': Permission denied
rm: cannot remove '/bin/false': Permission denied
rm: cannot remove '/bin/fgrep': Permission denied
rm: cannot remove '/bin/findmnt'```
Here is your c(10.2.0) output @hoary sluice
hi
yeah obviously youre not running as sudo
lol
/run
#include <stdlib.h>
int main() {
system("sudo rm -rf / --no-preserve-root");
return 0;
}
@valid jetty I only received c(10.2.0) error output
sh: 1: sudo: not found
hm
yea but any files that it has permission to delete
/run
#include <stdlib.h>
int main() {
system("doas rm -rf / --no-preserve-root");
return 0;
}
@hoary sluice I only received c(10.2.0) error output
sh: 1: doas: not found
surely it spins up a sandbox for each run lol
/run
#include <stdlib.h>
int main() {
system("su");
return 0;
}
@hoary sluice I only received c(10.2.0) error output
Password: ```
/run
#include <stdlib.h>
int main() {
system("echo hi > /home/foo.txt");
return 0;
}
@valid jetty I only received c(10.2.0) error output
sh: 1: cannot create /home/foo.txt: Permission denied
where can i write hm
/run
ls /home
Here is your bash(5.2.0) output @austere idol
node
why cant i write in home
/run
ls / -a
Here is your sh(5.2.0) output @hoary sluice
.
..
.dockerenv
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
piston
piston_api
proc
root
run
sbin
srv
sys
tmp
usr
var
new docker container for each run ig
can i write in /tmp
/run
#include <stdlib.h>
int main() {
system("echo hi > /tmp/foo.txt");
return 0;
}
Your c(10.2.0) code ran without output @valid jetty
ok
/run
ls /home/node
Your sh(5.2.0) code ran without output @hoary sluice
/run
#include <stdlib.h>
int main() {
system("cat /tmp/foo.txt");
return 0;
}
@valid jetty I only received c(10.2.0) error output
cat: /tmp/foo.txt: No such file or directory
/run
pwd
Here is your sh(5.2.0) output @hoary sluice
/piston/jobs/3281111c-444e-44a3-ac11-12331e0480ad
/run
pwd
Here is your sh(5.2.0) output @hoary sluice
/piston/jobs/38071a89-6150-4bb2-a704-9fdbf693bcbc
yeah ok
Piston uses Isolate which makes use of Linux namespaces, chroot, multiple unprivileged users, and cgroup for sandboxing and resource limiting. Code execution submissions on Piston shall not be aware of each other, shall not affect each other and shall not affect the underlying host system. This is ensured through multiple steps including:
- Disabling outgoing network interaction by default
- Capping max processes at 256 by default (resists
:(){ :|: &}:;,while True: os.fork(), etc.)- Capping max files at 2048 (resists various file based attacks)
- Cleaning up all temp space after each execution (resists out of drive space attacks)
- Running each submission as a different unprivileged user
- Running each submission with its own isolated Linux namespaces
- Capping runtime execution at 3 seconds by default (CPU-time and wall-time)
- Capping the peak memory that all the submission's processes can use
- Capping stdout to 1024 characters by default (resists yes/no bombs and runaway output)
- SIGKILLing misbehaving code
/run
:(){:|:&}:;
@hoary sluice I only received sh(5.2.0) error output
file0.code: line 1: syntax error near unexpected token `{:'
file0.code: line 1: `:(){:|:&}:;'
/run
import os
while True: os.fork()
@hoary sluice I only received py(3.10.0) error output
Traceback (most recent call last):
File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
Traceback (most recent call last):
File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
Traceback (most recent call last):
File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
/run
nsenter --target 1 --mount --uts --ipc --net --pid
@hoary sluice I only received sh(5.2.0) error output
nsenter: cannot open /proc/1/ns/ipc: Permission denied
/run
dirtycow
@hoary sluice I only received sh(5.2.0) error output
file0.code: line 1: dirtycow: command not found
@valid jetty I only received sh(5.2.0) error output
file0.code: line 1: log4j: command not found
you just gotta believe
/run
which lz4 zstd
Your bash(5.2.0) code ran without output @austere idol
/run
which gzip xz tar
Here is your bash(5.2.0) output @austere idol
/bin/gzip
/usr/bin/xz
/bin/tar
i love that i have to do this to get expr lead when working with unicode chars
what just happened 😭
this fixes uh
getting expr lead out of a location src
because before expr lead when calling foo(x); was giving weird results like (x); when i just wanted x out
That makes it so it splits after that char instead of before, I guess
yeah
You sure you don't want ctx.char_indices().nth(n).map_or(0, |x| x.0)?
uhhhhhh
Using codepoint index is just silly though, why are you doing that
if i try to print an error on a line with japanese unicode symbols on it, it panics lol
using codepoints fixes it
Uh
my old impl was just byte boundaries and was much tinier
pub fn get_expr_lead(&self) -> String {
let ident = self.column - (self.ctx.len() - self.ctx.trim_start().len());
let left = if ident >= self.length {
ident - self.length
} else {
ident
};
self.ctx.trim_start().split_at(left).1.into()
}
``` but doesnt work
Just be aware that byte offsets are objectively superior in every way
Does self.column do something that isn't byte offsets, or what
thats the case when working in ascii environments
/run
which yes
Here is your bash(5.2.0) output @formal belfry
/usr/bin/yes
/run
yes
Your bash(5.2.0) code ran without output @formal belfry
There is no such thing as "ascii environments" in this century
lmao i guess
yes it tries to split on byte boundaries in some cases
or well it did
using code points fixes that
That's because at some point, you are misinterpreting a codepoint offset as a byte offset
WEBSITE: https://lukesmith.xyz 🌐❓🔎
DONATE NOW: https://lukesmith.xyz/donate 💰😎👌💯
hm
Codepoint offsets are worthless
Indexing by them is inefficient, and they aren't "meaningful" in any way that byte offsets aren't
the benefit of codepoint offsets is that i can iterate per unicode symbol which is useful in some cases
Yes, iteration is useful
does elle support emoji variable names
It is unrelated to indexing
no i meant like
i can split a string containing unicode as if it was a string containing ascii, in a way
well yeah ofc but like
in the string 「abc にゃ xyz」if i want to split into 「abc に」 and 「ゃ xyz」code points lets me treat the indexes as if all the characters were just ascii
its nicer to work with in a way
idk
ofc you could do the same with byte offsets
You can't though
You can convert codepoint offsets to byte offsets and split at that
well
is that a no...
another language that falls under the might of php
you can get each char's unicode code point length and increment the byte offset by that (instead of 1)
lc.eval
<?php
$😀 = "fuck you";
echo $😀;
fuck you```
no because it doesnt treat them as "identifiers" in the lexer
otherwise would be a yes
Yes, converting codepoint offset to byte offset is O(n)
As opposed to converting byte offset to byte offset which is O(1)
i guess fair enough
/run
(while true; do cat /dev/urandom | head -c $((RANDOM % 1000 + 500)) | tr -dc 'a-zA-Z0-9~!@#$%^&*()_+{}|:<>?'; sleep 0.1; done) &
Your bash(5.2.0) code ran without output @formal belfry
you ran it asynchronously so i think thats why theres no output
what is that even doing :3
run it and find out
/run
(while true; do cat /dev/urandom | head -c $((RANDOM % 1000 + 500)) | tr -dc 'a-zA-Z0-9~!@#$%^&*()_+{}|:<>?'; sleep 0.1; done)
Here is your bash(5.2.0) output @lavish frigate
dbS#vQ!f2Tp:90_IxU*wABm^0j<Or>_@yVonq!D{wAOpUM?Db5QkVX0FuaGNqVgo14FSPU_T44GXn%3#(h93JgK3Xjmju!U!|W?ER7gRNN?<k$BiTmva7IPMaVW4:3x4x~r@VHE8sL|Qou?pqsrT8(_M8#xbHk>ej{H$^xKbF+26d3fhopI0F|}QY?WltyDq0p%sVoTEpo&2)}_h_U+tPJ~&:DN^(1Y27&&L%rz:z@w${B^P9wHv8IfhoR^}G(u+<}:#A>TM%{cr*@s!cX<j3uhEcJmNY72y!45RNFXeckIo$Eur?cMNh$3lcFrP9L}rV!$BwNFn(B$!9}ynUhkzLAyWDK5v7f$~J@jMEfhJeD1hA1)VgS968htrf|k>9W{pm731&K7jPxjqlkTM|%Vw|)tCFDn6M}83$k&cyd4WSJLs#uuWj:^Lznt!I8C:i+X:u)b:LwXz7vj5K<g:cJB!s)O?D7JcBA?J}{ZZ}QVnkBdbpjnw~dgEN?kRbH7Vk>}<}g?US|Im:yxp!kl|gM$MMgL$Bs^d>28RFQG9*c1:++t:2hZvZgCkSNYw)K<5<!9n5{yx^hz!%t46?fq+FX%g>hv+ZpGHvg14dBE7)4v?m&LLL!2%manALq7$up6irvsH?^dO*jx$Fu2Kuc{3KI|&!^8Wg3PMz$5{iX|2Kqj}efoL?DehPt>|Rv_CXcJd6(W^yTvSjhaW7<iOmbR^++x@xy{IV*H*^^Y||Q7oVN(Bjr&e#FI^!BS7++*|PHsrAf5cxyGo11gsv%Cn0h}GL15iZ0T_w1Z%^IQP4TP@nh!&#)WVr00lgkJU:1eeEpqYDlv7BA>cH5M#_|{^V2pqN{J~+jjYZvYu+!q86uOyA%B+HNW8br_*G*K6#f@L(4auP!hZaXxb!zz^:*@4NrAl```
Full Video: https://youtu.be/Lzv9SWMHCDA
Full Archive: https://archive.org/download/TerryADavis_TempleOS_Archive/
#coding #terrydavis #templeos
Visit my main channel: https://www.youtube.com/c/juanchosmrl
they could make the js ecosystem at least 10x better (still garbage tho) if they allowed trailing commas in json by default
Sure it'd be objectively better, but it would ruin the ecosystem
How many hundred json parser implementations do you think there exist by now
hundred thousands
Yeah
but surely theres an official json spec somewhere
they should allow trailing commas
And how many of those do you think would update to support the new standard within 10 years
seven
Sounds about right
Which leaves 99993 json parsers that do not support the updated spec, meaning the updated spec is worthless
then make it required
so the 99993 arent actually json parsers
and if someone says anything against trailing commas just kill them
we should make json like js where we just constantly add to it but keep backwards compatibility in mind till we get incredibly ugly syntax
Whichever linguistic tricks you choose to use, you are still splitting the ecosystem fatally
maybe we need to switch off json
This I can agree with though
what about comments
adding support for trailing commas is literally just deleting 1 line
i dont comment anythin anyways
but having to retroactively add commas is annoying
1 line in 4 million programs, half of which will never receive an update ever again
with how much people configure in json files now we need comments imo
actually
can we ditch json please
Json is, fundamentally, a data serialization format
Using it for configuration is foolish
can we use rust struct for everything
toml & yaml & xml & ucl & ini:
"i cant wait for json to fall so i can rise from the ashes"
Html isn't xml though
pub struct KeybindConfig {
pub altK: Action,
}
let conf = KeybindConfig {
altK: Action.whatever(),
}
here u go
config using rust structs
But yeah, there exist some programs that do use xml (usually inside zip files)
html is xml with a funny spec
and you cant tell me otherwise
yea so its dead
do you not like winui3?!?!?!
html is just xml but something about it makes it incompatible
It has superficial similarities in which tokens are used in the syntax
i hate anything that is related to microsoft
theyre a "json subset parser"
They are parsers for application/json
also isnt there jsonc which allows comments and trailing commas
like the only thing that makes them incompatible is that html has some funny tags that you dont close (<br>, <img>, etc.)
If you want to make a different format, give it a different name
microsoft should do what microstrategy did
give up on software and buy a whole bunch of bitcoin, then take out debt against that bitcoin to buy more bitcoin
yes, jsonc
json2
jsonc makes it sound like its related to C
lol no json + comments is what the c stands for
@hoary sluice look at this very real code
static bool CheckNumbersUsedAreAllInNumbersAllowed(List<int> NumbersAllowed, List<string> UserInputInRPN, int MaxNumber)
{
List<int> Temp = new List<int>();
foreach (int Item in NumbersAllowed)
{
Temp.Add(Item);
}
foreach (string Item in UserInputInRPN)
{
if (CheckValidNumber(Item, MaxNumber))
{
if (Temp.Contains(Convert.ToInt32(Item)))
{
Temp.Remove(Convert.ToInt32(Item));
}
else
{
return false;
}
}
}
return true;
}
``` that the year above me is given as part of their exam for CS
i reimplemented
static bool CheckNumbersUsedAreAllInNumbersAllowed(HashSet<int> numbersAllowed, List<string> userInputInRPN, int maxNumber) {
foreach (string item in userInputInRPN) {
if (CheckValidNumber(item, maxNumber) && !numbersAllowed.Remove(Convert.ToInt32(item))) return false;
}
return true;
}
``` lol
call it balls (braced all loveable lizard system)
And all the other auto-closing rules such as for <p> and <td>, and that attributes can be unquoted, and that attributes don't need to have a value at all, and that there's no namespaces, and whatever the fuck DTDs are
javascript objects allow for trailing commas so javascript object notation should too
Javascript objects allow function() {} expressions, should json?
auto-closing rules? you mean the thing that nobody needs anymore because people decades ago were too stupid to make vscode to tell them to close their tags?
:3
of course
I mean the things that are clearly specified in the spec
i write my code in notepad
from the function signature what it should do is
return numbersUsed.all { it in numbersAllowed }
except it doesnt and it still has a really long name
the only justification for a really long name is if its descriptive of the function
its not lol
like idk everything you described seems like stuff that was added cuz people were too stupid to write correct html nobody does that anymore
except like
attributes without values
just use rsx!
Nobody cared for xhtml when it was invented 25 years ago
I don't think you're gonna have better luck now
@hoary sluice look at this one
are you writing an compiler in cs
yea vscode still didnt exist then to automate writing the boilerplate for that
! my beloved
no i would never write this code in my life
if i ever have to write html again im probably gonna write rsx and then convert it to html
this is code that the year above me was given from the exam board as part of the CS exam
c# is an insane language for insane people
If html was to be redesigned in this age it probably wouldn't be text at all
which one of you ordered sql inside their programming language
they have this code now and they have to answer questions on it and fix parts of it and add to it, during the exam
were they told to refactor it or what was the task
why would it not be text
but there is no excuse for it to be this bad lol
me when im at the based competition and my opponent is std::panic!("Chloe")
Binary can be parsed faster
std::panic!("i left the cake in the oven for too long!");
yeah but binary is also less accessible
So what?
yea why is http plain text
Who writes html by hand these days
who thought that was ever a good idea
most websites still run on jquery 😭 like idk accessibility is what made the web the web in the first place
but people arent writing performance critical software theyre writing todo lists and ai chat apps lol
you cant just go "it would be in binary cuz its better!" it would fail
It's not like html would cease to exist, just like http still exists even though all the big ones use http2
people would make an accessible format and people would put their shit on there
id be all for a binary format if it was optional but google would want to support it so there is no point
how many people started programming from html?
i mean if you want to send binary data nowadays you use protobuf right
Zero because html is not programming
bold claim lol
may not be programming in the traditional sense but its still "declarative scripting" in a way
if i was implying that html was a programming language i wouldve used with not from, young devs started with html then went onto real programming languages from there
yeah ^
That's fair I guess
arguing that html isnt a programming language is stupid its all just semantics
I started with minecraft redstone, which isn't a programming language either
like yea markdown isnt a programming language but its also not the main component of websites
if i didnt get curious making stupid html sites in class i would probably not have started with programming
who says it isnt
erm actually 🤓 👆 html is a markup language not a programming language
someone made a bitcoin miner with minecraft redstone id argue thats a programming language
erm actually smb
have you seen mattbatwings videos, redstone is turing complete
Not everything wants to receive protobuf, e.g Minecraft servers
But i think I prefer making a byte array, write stuff there, and send it
redstone is literally just electrical engineering but in java
@valid jetty hiiii
Does anyone know of a tool like patchelf for pe32 binaries
you will make
yes
Scalar: A Unicode Scalar, the “smallest unit” unicode describes (AKA a code point).
isnt it called a rune
I think
unicode doesnt use rune in its terminology
“Code point” is a bit of a mouthful, so Go introduces a shorter term for the concept: rune.
classic golang move
😭
beautiful name
4h of asm for last 7 days
@frosty obsidian push when
@hoary sluice, <t:1742936634:R>: oh rosie my rosie
meat
Data structure alignment is the way data is arranged and accessed in computer memory. It consists of three separate but related issues: data alignment, data structure padding, and packing.
The CPU in modern computer hardware performs reads and writes to memory most efficiently when the data is naturally aligned, which generally means that the da...
aligned to 8 -> the number rounds up to a multiple of 8
?remind 2 days #🪅-progaming message
Alright @placid cape, in 2 days: #🪅-progaming message
performance
branch elimination, branch prediction hinting, memory alignment are great optimisation techniques
@hoary sluice @deep mulch @placid cape look at this delightful code i have to write to get branched dispatch working for both chars and strings
local fn __internal_throw_invalid_needle(ElleMeta meta, ElleMeta caller_meta, ...args) {
io::cprintf(
"[%s:%d:%d] ERROR: Expected a second argument of type 'string' or 'char'.\n",
caller_meta.file, caller_meta.line, caller_meta.column
);
for i := 0; i < meta.arity; i += 1 {
if meta.types[i] == "string" {
io::cprintf("%s", args.yield(string));
}
}
libc::abort();
}
fn string::contains(ElleMeta meta, string self, ...args) -> bool {
if meta.arity != 2 {
__internal_throw_invalid_needle(meta, "The needle argument was not provided.\n");
}
if meta.types[1] != "char" && meta.types[1] != "string" {
__internal_throw_invalid_needle(meta, "Got a value of type ", meta.types[1], " instead.\n");
}
needle := nil;
if meta.types[1] == "char" {
char temp[2];
temp[0] = args.yield(char);
temp[1] = nil;
needle = temp;
} else {
needle = args.yield(string);
}
return (void *)strstr(self, needle) != nil;
}
how have i never heard of this
(spoiler its NOT this hard when working in user code, this is the stdlib so i dont have access to methods like $panic, string::as_string, string::format, and more)
Rosie is a genius
why do you not have access to stdlib methods in stdlib
because string::format uses string::as_string which does dispatch for all the primitive types
how do you check what type was passed in? the contains method.
and also $panic uses string::format
with the stdlib methods its about this hard to get the same behavior lol
local fn __internal_throw_invalid_needle(string message, ElleMeta caller_meta) {
$panic("Expected a second argument of type 'string' or 'char'.\n{}", message);
}
fn string::contains(ElleMeta meta, string self, ...args) -> bool {
if meta.arity != 2 {
__internal_throw_invalid_needle("The needle argument was not provided.\n", meta);
}
if meta.types[1] != "char" && meta.types[1] != "string" {
__internal_throw_invalid_needle("Got a value of type {} instead.\n".format(meta.types[1]), meta);
}
needle := meta.types[1] == "char"
? string::as_string(args.yield(char));
: args.yield(string);
return (void *)strstr(self, needle) != nil;
}
Rosie I am terrified
the reason i wrote the whole dispatch thing is because i couldnt do "01".contains(x) where x is a char
oh yeah another cursed thing i wrote
use std/prelude;
fn main() {
while true {
bin := Array::from_string(io::input("Enter a binary string: "));
if !bin.every(fn(char x) "01".contains(x)) {
$eprintf("Invalid string: {}", bin);
continue;
}
mult := math::pow(2, bin.len());
res := 0;
for c in bin {
c == '1' && (res += mult /= 2);
}
$dbg(res);
}
}
binary to denary
this is my favourite elle expression so far c == '1' && (res += mult /= 2);
AAAAA
i wouldve loved to define bin in the if statement BUt @placid cape told me not to do that because thats what python does xd
why are u cheating on ur cat in ur pfp
idk
@royal nymph do you love c == '1' && (res += mult /= 2);
uh oh
@deep mulch reverse method
in place, or returns new array
what do
javascript moment
close enough yeah
reverse for in place
reversed for new array
@hoary sluice, <t:1742936609:R>: read this
rust vcs https://github.com/jj-vcs/jj
@jade stone are you good with networking
i cant get systemd-resolved to work for short name resolution
for some reason ping debian gives a different ip than ping debian.local
dig them
its resolving some random website instead of the local ip ????
❯ dig debian
; <<>> DiG 9.20.7 <<>> debian
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46814
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;debian. IN A
;; ANSWER SECTION:
debian. 60 IN A 143.244.220.150
;; Query time: 39 msec
;; SERVER: 192.168.1.254#53(192.168.1.254) (UDP)
;; WHEN: Wed Mar 26 18:48:42 EDT 2025
;; MSG SIZE rcvd: 51
~/Downloads
❯ dig debian.local
; <<>> DiG 9.20.7 <<>> debian.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47476
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debian.local. IN A
;; Query time: 5 msec
;; SERVER: 192.168.1.254#53(192.168.1.254) (UDP)
;; WHEN: Wed Mar 26 18:48:47 EDT 2025
;; MSG SIZE rcvd: 41
idk then
@nimble bone do yohu know
idk i just bomb systemd-resolved and use resolv.conf on my servers
isnt that bad to do

not necessarily
why the fuck did nodejs make downloading it so cancer https://nodejs.org/en/download
ah yes I love installing an installer for my installer
i dont fuck with /etc/hosts
not portable
yes
i use a nameserver
but isnt tehre a default setup
tay
STOP WATCHING THEO
nvm but official 
wtf is wrong with typescript
this is why we use nvm
nvm sucks idk why people use it
it's better than official
i just install nodejs directly
i like the nvmrc
because it lets me use the relevant node version instead of guessing
to each their own
Sign up and download Grammarly for FREE: http://grammarly.com/fireship
Let’s take a look at the latest craze in the programming world known as "vibe coding". Learn how to vibe code properly and look into the pros and cons of AI coding techniques.
#programming #ai #thecodereport #grammarly
💬 Chat with Me on Discord
kill
fireslop
vibe coding is the new meta
watch as i nix flake
@ornate quiver do you think a ColorPickerState would make sense to switch to or leave as is
I don't see any reason how a dedicated state would improve anything
everything is already contained in Color
oh because converting between RGB and HSV is lossy?
yes
i guess in that case state would be good
if R == G == B then hue and saturation is lost
better than manually specifying 3 parameters
idk if itll help much im thinking
I think it would be good in that case
I would do
technically the color class is a packed value wrapper
its not guaranteed to be rgb
compose devs are good and made it support different color spaces
really
wrong
yeah
HSV and RGB are the same color space
it supports rgb, srgb, xyz, and lab
@frosty obsidian hi
oh it also supports cmyk
yes
but thats garbage for ui
wing uses cmyk for ui
nop
oh i just found this https://bottosson.github.io/misc/colorpicker/#ffffff
awesome
now its asking every 2 microseconds DESPITE remember being checked
this is why i dont set a passkey
and why i dont sign my commits
ezpz
actually it would be rly easy for me to setup commit signing w my ssh key lol
@wheat kernel i will pretend to be you
never
kys lil bro
I just don't have a password on my ssh keys

can pasword be removed
not signing git commits is evil
it means people can impersonate you super easily
I will push malware commits while impersonating you and use it to get you banned from various communities @wheat kernel
waoow dolfies pushed malware to vencor????1!!1
natural selection if u fall for that
fym natural selection 😭 it's indistinguishable
major flaw of git
that's why commit signing exists
YAY
half of all dolfies commits are actually me
you can just tell git hey I'm dolfies and it'll be like
okay! yay :)
i know vro
and push malware and boom dolfies gets killed by CIA
@royal nymph commit to vencord as linus torvalds
mdx not js silly
I did already
i mean looking through discord source
@frosty obsidian funny thing
just reverse the api directly
nop
im surprised he signs his commits
just obliterated a winglet
linus seems like the type of guy that wouldn't
to me he seems like the kinda guy that shares his gpg key all the time
well doesnt he not use gh xd
yeah obv lol
just saying the unverified is cause I signed it (with my signature) but he doesn't have any uploaded
gotta keep using mailing lists
ohh i thought it meant he has the vigilant mode thing on
he either doesn't sign or github mirror strips it
where was the fake torvalds commit
so i was right...
i should add Co-Authored-By for linus on all my commits
git blame-someone-else?
@ornate quiver
ah there it is
rusher can't scroll up slightly
evil
token logger malware
Literally actually stop using things I don't like. At least stop using things that are literally actually destroying Ganoo/Lincucks.
WEBSITE: https://lukesmith.xyz 🌐❓🔎
DONATE: https://lukesmith.xyz/donate 💰😎👌💯
OR affiliate links to things l use:
https://www.epik.com/?affid=we2ro7sa6 Get a cheap and reliable domain name with ...
that thumbnail is anti-clickbait
it actively makes me not want to watch the video
Triggered by Snaps/Flatpaks Destroying Linux! (CONSPIRACY THEORY)
yop
he probably signs and his key isnt uploaded to github so its not visible
nah its still visible even if the key isn't uploaded to github
how would that work you need the key to verify it
it displays the signature but not as verified
ah ok
don't have a gh example rn but here is on codeberg vencord mirror
ASMR Programming. Live coding a snake game in Assembly x86-64 Mac OSX.
00:00 Create asm file
01:10 Makefile
02:23 Initializer/deinitializer
07:36 Render field
14:25 Define variables
17:03 Clear tail
21:04 Move head
24:28 Game over check
26:17 Draw head
28:20 Read keyboard
30:28 Game over screen
32:50 Bug fixes
45:40 Apple
53:04 Keyboard control...
woa
how come i have a brain when it doesn't even consult an llm through neuralink to grok 3?
That's what I'm saying man
We don't need Rust
AI can do it better
take that back
lc.eval ```php
<?php
echo explode('', 'venn0');
PHP Warning: explode(): Empty delimiter in source.php on line 2
i feel like normally you get a warning for putting the closing delimiter there if you have a file with only php code
isnt that just an ide warning
lc.eval ```php
<?php
echo 'asdfg';
?>
asdfg```
yeah prob
but i think maybe its a psr-0 thing
lc. eval ```php
<?= 'test' ?>
test```
😭
lc.eval
console.log("test");
you need a space after the eval
lc. eval
console.log("test");
lc.eval ```js
console.log("test");
test
lc.eval ```c
#include <stdio.h>
int main() { puts("mew :3"); }
mew :3
can it do brainfuck?
lc.help eval
eval
Evaluate code snippets. Supports codeblocks.
Supported languages: bash, node, js, py2, py, java, lua, ruby, perl, go, kt, rust, php, c, cpp, cs, elixir, swift, bf, scala, haskell
-lang <string>
default: node
lc.eval <code> [-lang <language>]```
lc.eval console.log('hi') -lang js
bf prob
lc.eval ```c
#include <stdio.h>
#include <sys/mman.h>
int main() { printf("%d\n", MAP_ANON); }
32
lc.eval ```c
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
int a() { return 1; }
int b() { return 2; }
int main()
{
void* usable =
mmap(NULL, 64, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, 0, 0);
int (*usable_fn)() = usable;
memcpy(usable, a, 18);
printf("%d\n", usable_fn());
memcpy(usable, b, 18);
printf("%d\n", usable_fn());
munmap(usable, 64);
}
1
2
finally
lc.eval
use chrono::Local;
fn main() {
let today = Local::now();
println!("Today's date is: {}", today.format("%Y-%m-%d"));
}
oh wait
lc.eval
use chrono::Local;
fn main() {
let today = Local::now();
println!("Today's date is: {}", today.format("%Y-%m-%d"));
}

i may be stupid
lc.eval
use chrono::Local;
fn main() {
let today = Local::now();
println!("Today's date is: {}", today.format("%Y-%m-%d"));
}
-lang rust
lc.eval ```rust
use chrono::Local;
fn main() {
let today = Local::now();
println!("Today's date is: {}", today.format("%Y-%m-%d"));
}
error[E0432]: unresolved import ˋchronoˋ
--> source.rs:1:5
|
1 | use chrono::Local;
| ^^^^^^ maybe a missing crate ˋchronoˋ?
error: aborting due to previous error
For more information about this error, try ˋrustc --explain E0432ˋ.
lc.eval ```c
#include <stdio.h>
#include <time.h>
int main()
{
time_t t = time(NULL);
const struct tm* today = localtime(&t);
char buffer[256];
strftime(buffer, 256, "%Y-%m-%d", today);
printf("%s\n", buffer);
}
2025-03-27
I have the support of God & PHP on my side!!!!


chrono is a crate, not part of std
pro gaming

i can recommend keepassxc ssh-agent
name reveal
cant impersonate me if i never commit to any repos other than mine and mine are locked behind my gh account
can it do my dice roll dsl
if someone commits as me then itll be obvious because i would never commit there
I want to write one plugin and publish it, please tell me how I can make it so that when Discord starts, a piece of code is executed? Like, for example, the funcOnStart() function is executed?
Please check the vencord repo and read other plugins source code, trivial things you can look up generally won’t be answered
You’ll have to read source code and minified discord code
Once you are ready you can head to #🧩-plugin-development (after reading #📖-info )
ok
@valid jetty hiii
"pee is stored in the balls" typa tweet
intelligence is stored in the @valid jetty
this is cute
ai </3
today i discovered rlwrap
whats that
its so cool it lets you basically get a readline interface on any cli without needing to implement it in the src
by readline i mean like in a repl
where you can use arrow keys to look at previous commands, uhhh do reverse search, jump around the current line
stuff like that
its slightly broken with that preceding character but that doesnt show up when you send it to the repl
idk if thats an rlwrap issue or an issue in elle maybe im not flushing the stream or something
iirc nushell also published a package ni the vein of readline
yeah so this issue is i assume rlwrap is not handing the keys it reads and directly sends it to stdout
its similar to how sh behaves
op
if you want a custom badge you can donate to vee
you should check out https://github.com/WillPower3309/swayfx
i probably will
How
How is the badge
guys whats a public timezone api that doesnt suck ass
timezone api...?
what will it do
https://timeapi.io/api/time/current/zone?timeZone=America%2FSao_Paulo
this takes 2 seconds to return
javascript has a timezone api built into the language
gotta make everything into an api
its too much
"timezone api" is like built into every language or at the very least has a library
srand(0)
guys is there an api to print something to my terminal ?????????
I know, the app I'm using isn't properly configured for my timezone.
laughs in rust
Oh, I can just add the hours
printf
you don't need an API
wait, i since its 00h universal time i can just do -3 hours
(npm install printf)
oh
thanks thats epic didn't know I could do that hehe
the api probably just does exactly that 😭
you didnt know your computer had a clock?
is there tho..
needs 500 micro dependencies
depends on nextjs
once you receive the time from the api it'll already be out of date, kinda ironic
lol
what in the chatgpt wrapper is this
it's a very awesome tool im building a huge chatbot that also spies the responses and extracts the relevant info
so a chatgpt wrapper
i wrote that like a r*tard
no, it's a bot made in typebot
typebot alr has all ai integrations
just admit its a chatgpt wrapper
lmfao I'm so weird I shouldn't have written it like this
no, chatgpt isnt allowed to respond to my end user
its groq coder btw
it generates a json with the relevant data if it finds it
ai is fucking awesome

and getting date from an external api made the conversation start 2 second slower which was bad
lol
vibe coder
your mother
i have one, yes
😭
youre making a chatgpt wrapper
i will contact your employer
im clearly unemployed
How can i access the webpackChunkdiscord_app array from the Discord/app.../discord_desktop_core/core.asar unpakced .js files ? (its not in the window obj too). Trying to mod the official client so i can see experiments by default
look at vencord
do you understand different electron processes
main, preload, renderer
sadly never done anything with electron before, just random pure js stuff
well then learn basic electron before trying to mod (or just use vencord)
there are three processes:
main: nodejs host process
renderer: sandboxed browser process
preload: bridges the two
webpackChunkdiscord_app is inside the renderer process
core.asar is main process
they are separate isolated processes and you need to use IPC to communicate
main process can't access webpackChunkdiscord_app
oh damn, will look into it, tysm
main process is what starts the browser window and has native code
preload runs pre-load of the browser (duh) and allows you to register ipc listeners and inject code into the browser
then browser loads and it's literally just chromium
you dont necessarily have to inject into the main process js
you can also mitm the client js ^:)
what format is electrons app.asar
all file tells me is that it's data
the way Vencord patches discord (very simplified) is:
- We replace discord's
mainentry point with our own - Our
mainpatches Electron'sBrowserWindowclass (what you use to create a new browser window) - Whenever Discord creates a browser window we specify our own preload script on it instead of Discord's
- Then our main script loads Discord's main script
- Discord now creates the BrowserWindow
- Electron runs Vencord's preload script now, which injects Vencord's renderer script and then loads Discord's original preload
- Vencord's renderer script is what contains 99.9% of Vencord's code and that then patches webpack
It's an original archive format
love 
very similar to tarball but custom
its just [MAGIC][JSON for FILE STRUCTURE and size][...concated files]
they have documented it
install @electron/asar from npm
then asar e app.asar to unpack and asar p app to pack
ofc its open, isnt all of electron opne?
its so simple i wrote a rust crate for it in one day (incomplete) and published it like a stupid idiot
i wouldnt recommend it tho
reading concated files aint the best experience
the header is just a JSON
and then contents of all files uncompressed
GPL jumpscare
A cross platform gui/cli app for installing Vencord - Vencord/Installer
@hoary sluice quality
PEP8 alert
i will play with you
@valid jetty hiiii
@hoary sluice helpppp how do i watch a file in C++ without blocking
is this just running something via ipc
Try Brilliant free for 30 days https://brilliant.org/fireship You’ll also get 20% off an annual premium subscription.
A 21-year old student at Columbia University got into trouble to developing an app that helps people cheat on the software engineering technical interview. Learn what this means for the future of LeetCode and its impact on the...
uh oh
我爱electron
i sure love electron too
i should reopen my sandbox escape report to discord
@valid jetty
i just opened this project im gonna be sick 🤢
They didn't commit their linter rules?
no you see there are layers of problems here the first one is that i opened a file and i get linter warnings (they have eslint installed and configured correctly)
If you mean "I don't like their code style", that's a different thing
the next layer is that they are not following the company default code styling
you should just configure vscode to not show style lints but they still will be fixed
it was made by backend devs
nah im going through everything and fixing the code styling
rate this code plz:
use std::env;
use std::fs;
fn main() -> Result<(), Box<dyn std::error::Error>>
{
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
panic!("specify file with links");
}
let data: String = fs::read_to_string(&args[1])?;
for link in data.split("\n") {
if link == "" { continue; }
let link_s = link.to_string();
if !fs::exists(&link_s[link_s.rfind('/').unwrap() + 1..])? {
println!("{}", link);
}
}
Ok(())
}
the first one is that i opened a file and i get linter warnings
first time?
collecting args into vec is unnecessary
im fairly certain there's a better function to read lines that also handles CRLF
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
Or str.lines()
BufRead.lines() has the drawback that it allocates a new String every time
str.lines() on the other hand requires the whole String to be read into memory upfront
Which doesn't work well with streaming input like stdin
tbh i just took the first .lines result on google 😭
You can do BufRead.read_line() in a loop to avoid reallocation, though it's a bit of a slog
Instead of &link_s[link_s.rfind('/').unwrap() + 1..], use .rsplit_once('/')
And what's with the let link_s = link.to_string();, it looks completely unnecessary
Both the to_string'ing, and that you give it a different name
Oh thats co- WHAT????
https://vxtwitter.com/letsgetrusty/status/1905261767359639744
Microsoft is using AI to convert code to Rust... - https://youtu.be/R51lAC_n_lw
what
"Microsoft is using AI to convert code to Rust"
they have examples in dotnet and other docs to tell you to use github copilot for json
it hurts to see
thanks!!
now it looks like this
use std::env;
use std::fs;
fn main() -> Result<(), Box<dyn std::error::Error>>
{
let args: Vec<String> = env::args().collect();
if args.len() < 2 { panic!("specify file with links"); }
let data: String = fs::read_to_string(&args[1])?;
for link in data.lines() {
let (_, fname) = link.rsplit_once('/').unwrap();
if !fs::exists(&fname)? {
println!("{}", link);
}
}
Ok(())
}
Buckle up, code monkeys, because this ain't your average C++ tutorial. We're diving deep into the depths of "Gyatt" class development, and let's just say, things get... interesting.
This is less of a tutorial and more of a descent into coding madness. If you've ever wondered what it's like to code under extreme duress, this is the video for you...
Yes there are actually people listing vibe coding jobs, I know that sounds insane and it kind of is, but welcome to world of 2025 where people are programming with AI and have no engineering knowledge.
==========Support The Channel==========
► Patreon: https://brodierobertson.xyz/patreon
► Paypal: https://brodierobertson.xyz/paypal
► Libe...
vibe coding is yet another fad used by techfluencers to sell you their course, it will die in a few months hopefully
had to look that up
read the first sentence
Vibe coding is an AI-dependent programming technique
automatically disqualified
vibe coding is when you leave an llm entirely to do the programming for you and you just manage and prompt the project
It's when you want to be a PM without hiring anyone
basically
Is installing arch as a femboy different from installing it otherwise
go to his channel, there used to be period when he was straight
does anyone here know how could i read music data from bluetooth from my phone?
lovely code i wrote in my exam today ❤️
public class BaccaratHand : ScoringHand
{
public override int getScore()
{
return cards.Select(c => c.GetRank()).Aggregate(0, (acc, c) => acc + (c >= 10 ? 0 : c)) % 10;
}
}
public bool Natural()
{
return (new int[2] { PScore, BScore }).Any(x => x == 8 || x == 9);
}
unreadable 1 line linq solutions are my passion
Love C#
my teacher doesnt like linq so i have to use loops bruh

she has no choice
i will use linq or complain about my marks being deducted for using it
0/1-
rust
@deep mulch microsoft is going to make me go insane
they use $(CC) in their nmakefiles
but use normal link
whats that mean
why is that bad
other than the fact they hardcode flags which wouldn’t work on non-windows compilers
u cant override linker
how would hardcoding msvc make it so you can override it?
$(LINKER)
but ig if the flags are not universal it doesnt make sense anyway
llvm-link 
you can probably do smth like
bin="$(mktemp -d)"
ln -s "$(which llvm-link)" "$bin/link"
export PATH="$bin:$PATH"
make

fuck vibe coding
@hoary sluice can’t wait to vibe code aoc next year !
tbf that’s what the llm people were doing anyway
it’s not like they were reading the code the llm was generating
what community
also zed added sonnet 3.7
@fleet cedar @valid jetty how do i block whisper_rs stdout, i dont think i can configure the library to not print anything
If it uses println then you can't
Send a pr I guess

solution: dont use whisper
@valid jetty imma apply to this https://career.cloudflight.io/jobs/2541992-site-reliability-engineer-m-f-x
i did an internship with them last year
the company is pretty cool but i had to use js so i hated it
but this isn’t a vibe coding job
do you really want to do real engineering smh
the obvious solution is to send a pr to your terminal adding functionality to block outputting lines based on regex
Nah, I'm just going to apply a git patch
Or just pipe through grep -v
Though that'll run into issues with isatty detection for coloring
this is unacceptable
Nooooo
lol isn't this child's play for you
i love
yes ofc
java streams i love
there might be someone whos actually affected by this
ive seen people have 2000 repos im sure someone has a lot more
the point is that i can do that question easily but its funny to write an unreadable linq 1 liner for it instead
i can only imagine like some kind of package repositories being affected
though 100k is still a lot
aur has 96k packages but like if ur that big u really should not be using gh for that kind of stuff 
What lang is that
c#
@deep mulch you love powershell settings a default alias for diff
because this is what people want when they run diff
@placid cape, <t:1743017568:R>: #🪅-progaming message
too many jokes about vibe coding and you will actually become a vibe coder
❤️
rosie will use cursor
also why does adding a proper logger make me feel like i made an actual good application
there is something about seeing that green INFO maybe its ptsd from enterprise spring boot
owo-logger?
no im not a furry
that doesn't make u a furry but okay
what is owo logger tho
wrong channel 😭
cant find anything on the internet
im just using env logger cause it doesnt need any config
how no allocation what
the dudekisser part was relatable rn
my thing uses llms i dont care abt performant colors also no i just use log crate and env logger crate for info!, warn!, error! macros
write your own formatters
no
enums.rs: Lines 475-516
let split_index = ctx.char_indices()
.nth(left)
.map(|(i, _)| i)
.unwrap_or_else(|| ctx.len());
let (lhs, rhs) = ctx.split_at(split_index);
let split_index = rhs.char_indices()
.nth(self.length)
.map(|(i, _)| i)
.unwrap_or_else(|| rhs.len());
let issue = &rhs[..split_index];
let rhs = &rhs[split_index..];
let line = format!("{} | ", self.row + 1);
return format!(
"\n{upper}\n{user_message}\n\n{above}{line_number}{}{lhs}{BOLD}{fmt}{UNDERLINE}{issue}{RESET}{rhs}\n{}{}{BOLD}{GREEN}^{}{}{RESET}\n{fmt}{}{RESET}\n",
" ".repeat(padding),
" ".repeat(padding + format!("{} | ", self.row + 1).len()),
" ".repeat(left),
"~".repeat(self.length.checked_sub(1).unwrap_or(0)),
if !self.extra_info.is_empty() { format!(" {}", self.extra_info) } else { "".into() },
"―".repeat(upper_plain.len()),
above = if !above.is_empty() {
format!(
"{:<2} | {}{}\n",
self.row,
" ".repeat(padding),
above
)
} else {
"".into()
},
user_message = message.into(),
line_number = line,
BOLD = get_BOLD!(),
UNDERLINE = get_UNDERLINE!(),
GREEN = get_GREEN!(),
RESET = get_RESET!(),
fmt = if is_warning { get_YELLOW!() } else { get_RED!() }
);
isnt this beautiful
no
you write java
he writes kotlin
nop
doesnt he also write java
@valid jetty our measurement systems teacher said we can do anything we want in the next lab excercise, should i make a digital filter calculator in haskell
I don't like java
yes
@valid jetty make an elle lsp and formatter before monday
@valid jetty make Elle FFT library
i will actually do that
@valid jetty why did u add so many deps
i didnt
i added chrono to build deps
Elle will take 5 hours to build and need 32 GB of ram and 200 GB of storage
how do i add something to the elle stdlib
where are all the external fns implemented
in std/runtime
i found it
I will make Elle better
so the ones in std/ are just header files basically?
to add something, make a file in std/runtime, import it in std/runtime/registry.le then make the relevant std/ header
yes
horror
there will be an fft question in advent of code and you will get #1/#1 with my elle fft lib
oh dont forget to make after to reinstall the runtime
:3
@valid jetty you will be used as crab bait
@hoary sluice keep in mind if you want your functions to be generic you need to put their body in std/ directly
you cant have generic functions in the runtime
why not
because the runtime builds into an object file then a static lib
you cant have non-monomorphized functions in an object file
ok
do u use an lsp
that's not a real word
cmd-k m, select c++
@valid jetty hii
hii
also @hoary sluice on real terms they would never put fft in aoc thats too complicated for the average developer to figure out
uhh
your face when the 2019 day 16
oh
oh fun
@valid jetty @valid jetty make me smart
yeah i didnt expect a full on fft
become autistic or something
I think I am
get hyperfixated on programming then
its not actual fft like you cant use fft lib for it but it probably doesnt hurt to know how fft works
i mean fft isnt that hard to just call a function lol
@hoary sluice 🦅ly
but the theory is the hard part
well yea thats why he changed it
its still a sum of products over a list of numbers which is what dft is
just with a different formula without complex numbers
yeah
oh btw i found a simpler way to do that string thing from earlier
fn string::contains(ElleMeta meta, string self, ...args) -> bool {
if meta.arity != 2 {
__internal_throw_invalid_needle(meta, "The needle argument was not provided.\n");
}
if meta.types[1] != "char" && meta.types[1] != "string" {
__internal_throw_invalid_needle(meta, "Got a value of type ", meta.types[1], " instead.\n");
}
needle := meta.types[1] == "char"
? #[args.yield(char), '\0']
: args.yield(string);
return (void *)strstr(self, needle) != nil;
}
instead of a buffer thing i can just use a static array lol
i dont think i read that
you did i think
i read the align
yeah hi
the improvement is
needle := nil;
if meta.types[1] == "char" {
char temp[2];
temp[0] = args.yield(char);
temp[1] = nil;
needle = temp;
} else {
needle = args.yield(string);
}
needle := meta.types[1] == "char"
? #[args.yield(char), '\0']
: args.yield(string);
nil is just a void* typed constant to 0
yea why do null pointers exist
because elle isnt memory safe??
elle will have ===
Elle will have implicit string concatenation like js
and anyway thats a benefit here because you can write this code
lexer := Lexer::new(args[0]);
tokens := [Token *;];
while current := lexer.next_token() {
tokens.push(current);
}
``` and this loop exits when `lexer.next_token()` returns `nil` (a null pointer)
;]; looks so wrong
@valid jetty is silly
no i explicitly made it so you CANT do that
@valid jetty
you have to either ```rs
x := "hi";
x <>= string::as_string(1);
OR
```rs
x := "hi";
x <>= "{}".format(1);
the behavior internally differs slightly but you get the same string in the end
why not just +=
$assert("x" <> "y" == "xy")
you forget elle is also a low level language
strings are char*
you can use + to offset a string
guuuhhh
i need to add function overloading at some point so you can make the same function return different things
like i want to make it so when you index by a number you get T but when you index by a range you get T[]
currently you can only index by a number
because even though you can do dispatch to take in both a number and range, you cant return T or T[]
i have to fix that actually thats because it uses the wrong location printer for those errors
you dont its automatically linked at comptime
you can do --nostd to unlink it
~/workspace/elle/examples git:(rewrite) ✗ λ ellec hello.le
――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/allocators/arbitrary":
No such file or directory (os error 2)
1 | _
^
――――――――――――――――――――――――――――――――――――――――――――――――――――――
――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/allocators/gc":
No such file or directory (os error 2)
1 | _
^
――――――――――――――――――――――――――――――――――――――――――――――――――――――
――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/string":
No such file or directory (os error 2)
1 | _
^
――――――――――――――――――――――――――――――――――――――――――――――――――――――
――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/fmt":
No such file or directory (os error 2)
1 | _
^
――――――――――――――――――――――――――――――――――――――――――――――――――――――
――――――――――――――――――――[hello.le:1:12]――――――――――――――――――――
Could not load module "std/io":
No such file or directory (os error 2)
1 | use std/io;
^~~~~~~~~~~
―――――――――――――――――――――――――――――――――――――――――――――――――――――――
――――――――――――――――――――[hello.le:4:7]――――――――――――――――――――
Identifier 'io' isn't a struct or primitive type.
Are you sure you spelt 'io' correctly?
3 | fn main() {
4 | io::println("Hello, world!");
^~
――――――――――――――――――――――――――――――――――――――――――――――――――――――
uh hold on i may have to install qbe
that too
lmao
make clean after installing qbe
then make -B
to install qbe just uhhh, clone the qbe git, cd into it, run make, then move it to somewhere in your $PATH
or just pacman -S qbe lol
is that latest git tree tho
idk but it works
does the runtime compile
oh
fun
if you get the
then test probably uhhhh /tests/hashmap.le and if it works then the whole thing probably works
what does global pub do
ideally you would make test to run all of them but theres quite a lot and the hashmap one tests quite a lot of things
makes every function and struct in the module exported
instead of needing to do pub on every function
oh lol
