#🪅-progaming
1 messages · Page 38 of 1
supports emojis in strings tho
tragedy
@ornate quiver sanity check on the grammar
google translate spits back logical words but i dont trust it for one bit
its even funnier because i just cannot write anything in my terminal using my ime
i have to write it elsewhere and copy paste into the terminal input
tomorrow I don't have time right now
bleh
is there a way to see each plugin's settings easily
like in JSON form
preferablly with default values if applicable
and if the setting is optional or not^
Currently the closest I've gotten is pnpm generatePluginJson but that only gives me plugins
Just iterate each plugin
Like, each file?
At runtime
I'm not smart enough to edit this script to add definePluginSettings
I need it before
For what
Ok, this will sound stupid but this is how I like to do stuff.
I wrote a script to clone and build vencord from source because sometimes I like to edit some plugins. I have a vencord settings backup in JSON in a folder which is like the storage basically. I wrote a script that gets the plugins with generatePluginJson and makes sure the stored backup doesn't have any old plugins and adds the new plugins. I want to also add that for plugin settings but I don't know an easy way to do it
Also, even if I did it during runtime my issue still remains
because I do this Vencord.Settings.plugins.AlwaysTrust.hi = true and if I export the settings
it'll have "hi": true in the json backup
So the only way I can validate what settings exist is if I reset all settings and then checked
does the default value get set only on mount? How can i make the text change on currentSlide change?
oh well i just added it to value={...}
seems to work enough
Makes sense that the default value only applies when first created
@valid jetty can you write a program with n^n complexity
i have no idea how lol
def f(n):
if n <= 0: return
for _ in range(n**n):
pass
can you
oh 😭
@hoary sluice LMAO
i wrote my own utf8 lib because it simply does not exist yet
fn rune::encode(rune *self) -> string {
let result = "";
let code_point = self.inner;
if code_point <= 0x7F {
result.push((char)code_point);
} else { if code_point <= 0x7FF {
result.push(0xC0 | (code_point >> 6) & 0x1F);
result.push(0x80 | (code_point & 0x3F));
} else { if code_point <= 0xFFFF {
result.push(0xE0 | (code_point >> 12) & 0x0F);
result.push(0x80 | (code_point >> 6) & 0x3F);
result.push(0x80 | (code_point & 0x3F));
} else { if code_point <= 0x10FFFF {
result.push(0xF0 | ((code_point >> 18) & 0x07));
result.push(0x80 | ((code_point >> 12) & 0x3F));
result.push(0x80 | ((code_point >> 6) & 0x3F));
result.push(0x80 | (code_point & 0x3F));
}}}}
return result;
}
rust chars are also wide while theyre 1 byte in elle
i think im taking this too far
関数 足す(整数 x、整数 y)『
返す x+y;
』
関数 メイン()『
整数 結果 = 足す(1、2);
プリント(「こんにちは、世界!」);
プリント(結果);
』
its a lexer
main.igo: Lines 1-100
関数 足す(整数 x、整数 y)『
返す x+y;
』
関数 メイン()『
整数 結果 = 足す(13、26);
プリント(「こんにちは、世界!」);
プリント(結果);
』
lmao
syntax is slaying here actually whaaa
use std/prelude;
use lexer;
fn main(string[] args) {
program := args.remove(0);
$assert(args.len() == 1, "Usage: {} file.igo\n".format(program));
lexer := Lexer::new(args[0]);
tokens := [(string, string);];
while current := lexer.next_token() {
tokens.push(current);
$println(*current);
}
}
Lol
they both look nice, but i think cards looks a little nicer
but kinda depends what it's for
markdown alerts
are you making a markdown renderer?
im styling markdown
ah
this is for a github client
hello guys
do you think this commit msg is too verbose, like should i not mention the error in the commit msg? only keep bump version
idk i never really made a public pr
being verbose in commit descriptions is good
webp
install RefinedGithub extension
if it's too long it yells at u
https://addons.mozilla.org/pt-BR/firefox/addon/widegithub/ lol looks a lot nicer on a big screen
brazilian spotted....
yes thanks
if it’s a pr i usually write down all this info in the pr body itself
and not in the commits
bc anyways it usually ends up being a one commit in the repo if they squash merge
Omg that's so cute
@torn seal is this u
@royal nymph when are you making a german language
関数 足す(整数 x、整数 y)『
返す x+y;
』
関数 同一(整数 x)『
返す x;
』
関数 メイン()『
整数 結果 = 足す(13、26);
整数 あああ = 同一(39);
プリント(「こんにちは、世界!」);
プリント(結果、あああ);
』
someone already made
wtf
rewrite elle in this https://github.com/michidk/rost
why would you do that
how would you represent upper plane characters in a byte
We have this
https://github.com/Toaster192/czech.h
yop
what
elle maintains C abi compatibility so strings are cstrings and chars are ascii bytes
there's a reason why rust chars a 32bit
as you go to higher planes or blocks the byte size of the utf8 encoded character increases
overthrow unicode
i know lmao
i'm working with unicode in my language made in elle
rust chars are also not always 32 bit they're code points
they vary in length based on the first byte
stored as 32 tho
utf8.le: Lines 11-21
fn char::unicode_length(char byte) {
if (byte & 0b10000000) == 0 {
return 1;
} else { if (byte & 0b11100000) == 0b11000000 {
return 2;
} else { if (byte & 0b11110000) == 0b11100000 {
return 3;
} else { if (byte & 0b11111000) == 0b11110000 {
return 4;
}}}}
}
yeah i guess
UTF8 strings are c abi compatible (if they're null-terminated)
that is exactly what i'm taking advantage of
lexer.le: Lines 130-132
if c.encode() == "「" {
return $("string", self.consume_string_literal());
}
instead of semicolon a japanese period would be funny
Comments use ※, yes?
rewrite in https://github.com/phaux/rdza
i use that for floating points 😭
No floats should use https://en.wikipedia.org/wiki/Japanese_numerals#Decimal_fractions
Also suggestion: 九十八 is a i32, 玖拾捌 is a i64
LMAOOO
ElleとQBEを用いておもちゃのコンパイル型プログラミング言語
What is the purpose of 型?
I could see it being written this way:
ElleとQBEを用いているおもちゃのプログラミング言語
- これは学校のプロジェクトです。
or just - 学校のプロジェクトです。
すべて詳細に記録されます
Id use 全部 instead of すべて here
i dont know causative form so idk about the second half of the sentence
- 全て日本語で書いていますのは面白いからです。
- すべて日本語で書くのは面白いからです。
nominalizing verbs with の・こと only works with plain form
some things you might want to know:
- a lotta natives shorten 〜ている to 〜てる
- according to jisho 全て is written usually in kana
and according to my sensei apparently it's more formal/fancy than 全部 while having almost the same meaning
this is also just with a bit of research and my limited knowledge :bleh:
lc.gemini whats wrong with rusher
分析と改善点
ご指摘ありがとうございます。 丁寧な分析と具体的な改善点のご提案、大変助かります。一つずつ確認し、より良い表現へと修正していきましょう。
1. 「ElleとQBEを用いておもちゃのコンパイル型プログラミング言語」
- 問題点:
- 「ElleとQBEを用いるおもちゃのプログラミング言語」の方が自然な日本語です。
- 「コンパイル型」という言葉は、文脈によっては専門的で分かりにくい可能性があります。
- 改善点:
- ご提案の通り、「ElleとQBEを用いるおもちゃのプログラミング言語」と修正します。
- 文脈に合わせて、「コンパイル型」の説明を加えるか、より一般的な表現に置き換えることも検討できます。
2. 「これは学校のプロジェクトです。」
- 問題点:
- 両方の表現とも正しい日本語です。
- 改善点:
- 文脈や強調したい点によって使い分けると良いでしょう。
- 例えば、プロジェクトの重要性を強調したい場合は、「これは学校のプロジェクトです。」の方が適しています。
3. 「すべて詳細に記録されます」
- 問題点:
- 「全部」も「すべて」も正しい日本語ですが、「全部」の方が口語的でカジュアルな印象です。
- 「詳細に記録されます」の「されます」は、受動態で少し硬い印象を与えるかもしれません。
- 改善点:
- 文脈に合わせて使い分けると良いでしょう。
- 例えば、より丁寧な表現にしたい場合は、「すべて詳細に記録いたします。」と「いたします」を用いることもできます。
4. 「全て日本語で書いていますのは面白いからです。」
- 問題点:
- ご指摘の通り、「すべて日本語で書くのは面白いからです。」がより自然な日本語です。
- 「のは」は、名詞化の助詞ですが、動詞の原形にしか付きません。
- 改善点:
- ご提案の通り、「すべて日本語で書くのは面白いからです。」と修正します。
5. その他
- 〜ているの省略:
- 口語では「〜てる」と省略されることが多いのは事実です。しかし、書き言葉では、特に丁寧な表現を求められる場合や、相手に正確に意味を伝えたい場合は、省略せずに「〜ている」と書く方が望ましいです。
- 全ての表記:
- 「全て」は、漢字で書く場合とひらがなで書く場合がありますが、どちらが正しいという決まりはありません。文脈や個人の好みによって使い分けることができます。
まとめ
ご指摘いただいた内容を参考に、より自然で分かりやすい日本語に修正しました。
修正後の文例:
ElleとQBEを用いるおもちゃのプログラミング言語です。これは学校のプロジェクトで、全て日本語で記述しています。日本語でプログラミングをするのはとても面白いからです。
その他
- 「型」の目的については、文脈によって様々な答えが考えられます。例えば、プログラミング言語においては、データの型を指定することで、プログラムの安全性や効率性を高めることができます。
- 「causative form」については、文脈や状況に応じて適切な表現を選ぶ必要があります。
ご不明な点や、さらに詳しい説明をご希望の場合は、お気軽にお尋ねください。
追加で何か知りたいことはありますか? 例えば、以下の点について詳しく説明できます。
- ElleやQBEといったプログラミング言語についての情報
- コンパイル型プログラミング言語の特徴
- 日本語でプログラミングをするメリット・デメリット
- 学校のプロジェクトでどのようなことに注意すべきか
ご要望に応じて、様々な角度から情報提供させていただきます。
SPEAK ENGLISH
No don't
lmaoo
watch the AI just destroy my corrections probably
also @valid jetty don't use Google translate, DeepL is much more reliable
use gpt
LLMs are pretty good at translation
why did you husk
all they do is generate text
i feel like google translate is more reliable, but less accurate, and deepl is slightly less reliable, but usually more accurate
great idea
i don't use google translate i only used it to see if it created legible words when translating my slop to english
anyway this is very helpful thankies
i was trying to be explicit and write compiler type programming language
answering for why 型
true
Which according to wikipedia is コンパイル型言語
ah very close to your original lol
oh wow yea
The language selector on wikipedia is very useful for translating specific terms/concepts
where is that/how do i do that
oh you just mean using a different language on wikipedia
i thought you meant like you input a phrase in english and then if it has that phrase, it'll translate it
i love how you recommend 全て and then say jisho says it's usually written in kana which is exactly what i did
They recommended 全部 though, not 全て?
yeah sowee
i'm assuming you meant すべて is more formal than 全部 though which is why you recommended it? trying to understand what you meant
nvm i see
i'm actually silly
😭
ok how is this
ElleとQBEを用いておもちゃのコンパイル型プログラミング言語
学校のプロジェクトですから全部詳細に記録されます。全部日本語で書くのは面白いからです。
これは私が作った別の言語であるElleプログラミング言語を使用してます。
localized programming languages scare me
also makes me wonder what went down in history for us to just agree that languages using english based grammar/syntax are sane
i dont know causative form so idk about the second half of the sentence
in 全部日本語で書くのは面白いからです
everything japanese written (nominalizer) funny because
the から comes right after the reason, its a basic use of causative form
so it forms "everything is written in japanese because its funny"
they are
writing in pure jp is annoying
i should learn jp at some point
english has no diacritics which makes it very easy to form words with a small alphabet
m interesting
i hope you know 面白い lol
its one of the first kanji i ever learnt other than 私 and 一ニ三四五六七八九十
ive decided that いちご will not have any decimals because its too much effort to program them
but that means silly
関数 足す(整数 x、整数 y)『
返す x+y。
』
関数 同一(整数 x)『
返す x。
』
関数 メイン()『
整数 結果 = 足す(13、26)。
整数 あああ = 同一(39)。
プリント(「こんにちは、世界!」)。
プリント(結果、あああ)。
』
it lexes
Why is it 返す x and not xを返す
because my aim isnt to make gramatically correct sentences
:(
and also lexing that would be hard
they would all be 1 big identifier i think
yea
jp having no spaces inherently makes it very hard to seperate tokens
i love (hate) langauges that do not have separators, gotta use some random ml model by google to do line breaking for hem
thats why i count ” ” as whitespace
fn Lexer::skip_whitespace(Lexer *self) {
while !self.is_eof() && (char::is_whitespace(self.current_char().inner)))
|| self.current_char().encode() == " " {
self.advance();
}
}
i might look into writing my own
it would be really funny i think
to write gramatically correct sentences but not even in english, in japanese
my teachers are gonna take 1 look at this and give me a 0
I did get a "looks good but please write in english" on one assignment
I only wrote the example program in japanese though, the actual implementation was in english
I did make sure to follow the designated output format - I even decompiled the check program - how can they complain?
the project is supposed to have at least 2-4k lines of code and im meant to reference where i used the concept lol i am so done for
at the very least my source code is in english https://github.com/acquitelol/ichigo/blob/mistress/src/lexer.le#L69-L86
lexer.le: Lines 69-86
fn Lexer::consume_string_literal(Lexer *self) {
self.advance();
res := [rune *;];
while !self.is_eof() {
current_char := self.current_char();
if current_char.encode() == "」" {
self.advance();
break;
} else {
res.push(current_char);
self.advance();
}
}
return res.map<string>(rune::encode).join("");
}
like you can understand it
maybe i should make a rune *[] method to turn a bunch of runes into a cstring
like just
fn Array::utf8_encode(rune *[] self) {
return self.map<string>(rune::encode).join("");
}
how did you write in jp in what im assuming C or C++
like just the function names are romaji or?
Just the printed strings
oh
Pretty sure it was either haskell or java btw
lmfao
oh god i should probably make it so that you cant cant a pointer to any other pointer right
mem::transmute
Eh, who cares? All other languages with pointers allow that
🥰
uhhhhhhhhh
not when you can call this method on an array of tuples of strings and the compiler just allows it
that's hilarious
jp in a nutshell

hey ho, im looking for a plugin that can hide that im sharing my screen in my status. I dont want others know that im sharing my screen right now.
If a plugin like this doesnt exist, does someone know if there are techincal limitations that would hinder the developement of such plugin ?
Just wanted to share some progress on the debugger implementation that @Twanthedev and I are making for the @zeddotdev editor👀
calc is short for calculator btw
Does someone know how pmms/vmms work together with 4 level paging
No
@loud sphinx
HORROR OPERATOR OVERLOADING
real
kotlin has operator overloading too but they're intuitive at least unlike that
like listOf(1,2) + 3
yea, i dont mind operator overloading when it makes sense
Which alert style
11
12
1
Cards
interesting
poll is closed but second one is better
it seems most people prefer the cards
most people are wrong 
regardless, thats the design ill go forward with
ushie will go crazy
you're wrong 

scary
at least its not majority js
@valid jetty @deep mulch good morning !!!!!!! 😄 😄
make it all JS 

i love supabase
why do you need to sanitise css
a strict csp should do the trick
Im letting the user to specify their own css
In my app i mean
- don't
- you need a strict csp that blocks external resources
do you need any sanitization or security if the user uses the css locally :^)
unless the user is user some super ancient browser like Internet Explorer, there shouldn't be a way for css to execute js afaik
if they do use Internet Explorer than that is possible
Eee there's share button
the biggest risk from css is ip logging, tracking and keylogging
all of which can be done by fetching external links
if you block all external links with csp this is not a risk
tf were IE devs were on when implementing that
arc boost incident in the making
browsers were very old and css was very limited and things like math function in css didn't exist
so they went oh yeah this is gonna be a banger idea
body {
width: expression(document.body.clientWidth > 1100) ? "1100px" : "auto";
}
this emulates max width for example which wasn't a thing back then
back then stuff like that didn't exist so you had to do so much stuff with js
I can just regex cut it out, no?
unless you support Internet Explorer (why) this won't be a problem
just use csp to only allow fetching from domains you use
you should do that either way
@hoary sluice apparently the reason dp is called dp is because the guy who invented it though it would be funny
and because he wanted to make it look to his boss like he was doing something advanced
but unless it's a small hobby site supporting custom css is bad anyway cause people can always do stuff like make the ui unusable
like * { display: none }
dp is called dp because the guy who invented it wanted a short way to name his recursive functions
the foo in question:
u cant use foo in a whitepaper algo impl
Also is there any way to sort of "sandbox" it? So the user can't do * selector to mark the whole page
not really
you absolutely can and i will
it's impossible to make it so they can't break the page
Lol
@ornate quiver they said they’re gonna give me a 0 if i write the docs for いちご in jp
😭
.random-element {
width: 10000px;
}
they’re just haters i’ll do it anyway
no you cant its physically impossible
already broke the age
nooooooo lol
the best you could do is not allow css and instead allow very very specific things like letting users change the colours (even then they can still break the site by making everything one colour lol)
my teachers must hate me sm bc of all the jp i’m bringing into their clean cozy christian environment
Well so uhhh, the point of the app is to be able to make "presentations" using html/css lol. Well now I'm thinking about it. Perhaps letting the user only use tailwind styles would be good enough
Bun 1.2 introduces a built-in Postgres client, built-in S3 object support, a new text-based lockfile, and a major update to Node.js compatibility.
Check out our blog for everything that changed in Bun 1.2:
https://bun.sh/blog/bun-v1.2
Bun is a complete toolkit for building and running full-stack JavaScript and TypeScript applications. It's a N...
who even watches these tbh
idk why stuff like nextjs does it
dude
just drop me a blog post
with bullet points
Read more about Deno 2: https://deno.com/2
00:00 Cold open
02:37 Keynote
03:59 Demo: a program in a single file
08:31 All in one toolchain
09:05 Deno compile demo
10:39 Announcing Deno 2
11:58 Next.js demo
14:18 Node and npm compatibility
17:22 Package management
18:17 deno install demo
19:00 JSR
20:14 Deno standard library
21:18 JSR demo
27:20...
🔥
the osu one is kinda good
different purpose but yeah
ping pong
is xcode debugger connected
is that an issue
very much
why lol
problems with permissions bc xcode needs to have the perms rather than the app you're building
and doesnt always work
idk i havent looked into it
first launch takes ages btw
huh
will profile
@native spruce ClipperApp.swift line 88 ish
remove dispatchqueue.main.asyncafter
you can probably make a new window scene for setup
swiftui is annoying and also idk how that stuff works
i just used appkit it makes sense to me
its ok if it works dont fix it
true story
also this is easier for the logic of showing perms setup window before onboarding view
whats skylight.framework
is this per launch
oh yeah that makes sense actually
every launch but first time u open the sheet during that launch
any images visible are resized and then sent back to the view for display
it shouldnt be that intensive though
and then are kept in memory so never need resizing
last commit was fine
thats looks like part of swift runtime
ignore it then I guess
the profiler doesnt give me much informatino on whats going on
and it crashed
the main change that happened with the intensive work is i detached their tasks to stop running on mainactor
try doing a global replace for Task.detached to Task
then profile again
but then its all on mainthread
I found the issue
open this in xcode and copy the entirety of its contents
this probably happened last commit actually
but im not sure
@woven mesa if possible we shouldn't try to display the entirety of code or text
this file is 31kb in size
fixed
will push in next commit
@native spruce btw i just trimmed the attributedstring down to 1024 chars
here code if you want to test early
I think we should only display what the person would actually see
we cant like scroll in the card
its difficult to tell due to different ways the text could be formatted
yeah :(
whats coretext
the thing that handles all of text rendering in all of apple's operating systems
I see
it can give info on text rendering bounding boxes
im thinking of doing some swiftdata optimizations
wow nazis really are everywhere these days....
huh
idk what the joke even is so
any chance some1 knows if its possible to implement your own module imports with dynamic type infering in TS?
trying to do
const typed = await myCustomImport('./file.ts')
the best you can do is
await myCustomImport<typeof import("./file.ts")>("./file.ts");
but also this seems like XY problem, why do you even need this
Tfw the 5090 leak from a few months ago was actually true
I wonder if this works
async function myCustomImort<T extends string>(path: T): typeof import(T) {
...
}
if I were to guess, it doesn't
nah it doesnt lmao
lazy to try rn tho
wishh it could lol
typeof import only works with static string
i'm making a multi-threading library, and i want absolutely minimal boilerplate to get it to work:
main
import type extensionLoader from './worker'
import { wrap } from 'abslink/worker'
const Loader = wrap<typeof extensionLoader>('./worker.ts')
const life = await Loader.stuff()
worker
import { expose } from 'abslink/worker'
export default expose({
stuff() {
return 42
}
})
this is the least i was able to get it to
the export default isnt required, but its the easiest way to expose the data without duplicating or explicit declarations
the problem with threading in all js envs, is that it needs to be done in a separate file, it makes me fume
you cant just go "this function is threaded, do make its memory operations unsafe"
i mean IIRC there was a proposal for this, but I can't find it :/
anyways, this is also meant to support IPC, so for example you could use websocket as the message channel, and run the worker code on some server, or even in a a different language if you re-implement the library
which isnt difficult at all
@valid jetty typeof import is about as cursed as me making function declarations be expressions
not really
its fairly normal do to if you dont want to declare your own types, only have them inferred
safe to assume not an XY problem then?
i flat out do not see a diff way of doing this
yeah there isn't any better solution better than what you have
but what you have is pretty clean I would say
vencord has exactly that xD but yeah it also uses typeof import
https://github.com/Vendicated/Vencord/blob/c8f4ce978595965a9a6da92dd8fe13f9cc826b61/src/plugins/translate/native.ts#L9
https://github.com/Vendicated/Vencord/blob/c8f4ce978595965a9a6da92dd8fe13f9cc826b61/src/plugins/translate/utils.ts#L29
https://github.com/Vendicated/Vencord/blob/c8f4ce978595965a9a6da92dd8fe13f9cc826b61/src/plugins/translate/utils.ts#L138
native.ts: Line 9
export async function makeDeeplTranslateRequest(_: IpcMainInvokeEvent, pro: boolean, apiKey: string, payload: string) {
utils.ts: Line 29
const Native = VencordNative.pluginHelpers.Translate as PluginNative<typeof import("./native")>;
utils.ts: Line 138
const { status, data } = await Native.makeDeeplTranslateRequest(
yours is very tightly integrated with IPCMain, which supports that
i want it to work over ANY message channel, even HTTP requests, UDP packets etc
but yeah i assumed i arrived at the conclusion
i dont think it can get much better without a TS plugin
which means a serialization protocol for object accesses
TLDR what comlink did
yeah but electron ipc literally just sends what essentially is a json message, wouldn't be hard to make http / udp adapters for it
but those will of course be much more delayed
the second best thing you could do is codegen
nah, IPCMain serializes it via V8 iirc
kinda like what transferables do for W3C MessageChannel
I dont want the developer to ever have to worry about that
they expose the object
and they call it
this is what a lot of libraries like prisma do
you run some command which analyses your files and then generates .d.ts files
no funky states etc
yeah i'm aware of that being an option
but i dont like it, because its too much work and too many potential compatibility problems
oh yeah i absolutely agree
I hate that too and you have to restart your IDE for ts to realise those files changed
well you dont, using a ts plugin works
thats what gql.tada does
and it works REALLY good
but i fucking shiver when i look at the implementation
its an ungodly amt of effort
you need to restart the tsserver but I just restart my ide cause it's faster
unless that plugin does some horror stuff
it does horror stuff
its mad
i'll stick to what i got then
doesnt seem like it can be improved much at low cost
yeah that's already good
yeah its x1000 better than what we currently have in js
having to manually do postMessage or invoke suuuucks
oh yeah the only thing i didnt get working yet is remote constructors
aka
const x = await new wrap<typeof remoteConstructor>('./worker.ts')(options)
it works, but calling the constructed class's methods will interfere with the exposed constuctor
and will call both the class, and the constructor
oopsie
but i'm reaching the point where typescript is kinda shitting itself
it doesnt like automatically promisified class methods
cuz doing await exposedObject.property.nested works, but TS thinks all the steps are async, rather than just the last one
and it expects to await each key, even tho u dont need to
:/
lol this is way too specific to be able to help without seeing the actual code
that sounds really cursed
oh nah not asking for help
just.... showing
or i guess talkin about it
i know what the issue it, it calls both exposed properities as its a single channel
not sure how i'll fix it yet
for the typescript thing....
yeah idk i gave up on typing it like that
abslink.ts: Line 84
export type RemoteObject<T> = { [P in keyof T]: RemoteProperty<T[P]> }
abslink.ts: Lines 46-50
type RemoteProperty<T> =
// If the value is a method, abslink will proxy it automatically.
// Objects are only proxied if they are marked to be proxied.
// Otherwise, the property is converted to a Promise that resolves the cloned value.
T extends Function | ProxyMarked ? Remote<T> : Promisify<T>
I expected that to work...
it didnt....
because its just an object that becomes async
since its threaded
so sync properties become async
and async stay async
wait so foo.bar is a promise but foo.bar.baz works and also is a promise?
yes
try ```ts
type RemoteProperty<T> = ... : Promisify<T> & { [key in T]: RemoteProperty<T[key]>; }
you'd do await foo.bar or await foo.bar.baz
and both would work
but TS expects
await (await (await foo).bar).baz
idfk why
it makes sense cause u mark it as Promise
you need to also do something like this
arent you're doing the inverse
?
you're also doing await (await (await foo).bar).baz
i need await foo.bar.baz
this is assuming
const foo = { bar: { baz: 42 }}
no
oh i see
im dumb
sry i'll need to check later
on wrong pc as of now
but it seems promising
thanks for helping i'll check soon-ish
you're currently just marking it as Promise<T> but you need Promise<T> & Record<keyof T, RemoteProperty> so you can treat it like a normal object
also damn this is some cursed stuff 😭 proxy moment
how does that even work how does your proxy know what the last property access is (so it can make the ipc call)
do you just resolve it on the next tick or something
when you get from a proxy u get the full accessor list
so you get an array of parmeters
i just serialize the array
then do path.reduce((obj, prop) => obj[prop], (obj as any))
not my code tho, this is stolen from google
just google's ver was HARDCODED to work only on W3C MessageChannels
which is useless
yeah the impl is INSANELY cursed
but the end result
is fucking AMAZING
main
import type extensionLoader from './worker'
import { wrap } from 'abslink/worker'
const Loader = wrap<typeof extensionLoader>(worker)
const life = await Loader.stuff()
worker
import { expose } from 'abslink/worker'
export default expose({
async stuff() {
return 42
}
})
you can't tell me this isnt sex
u don't tho, you have to track the property access chain urself
and you have no good way to know which the last property access in the chain is
the only way i can think of is using something like setImmediate to fire in a future tick (all synchronous code has been executed here so you know the property access chain has ended)
ah yeah
it just creates proxies recursively
if the prop isnt an await it just keeps returning proxies recursively, creating a path from it
since the end result is ALWAYS a promise/await, you just wait for said await to occur
and awaiting an object always calls its .then, which is how u can implement promises yourself in js
its cursed
.then is less cursed than the solution i thought of
aka deferring to next tick?
yea
the next tick trick is how vencord lazy webpack allows you to destructure
fortunately the props are cached, so this recursive bs only happens once on initial call
const { getUser } = findByPropsLazy("getUser");
// findByProps not fired yet
doSomeStuff();
// still not fired
getUser("1234567890"); // now fires findByProps
js is wonderfully cursed
i love it
wow insane
but this is peak threading for me at least in JS
i remember there being some proposal for
unsafe {
}
or smth like that
that allowed you to do inline multi-threading
but i CANNOT find it for the love of my life
that
would
be amazing
yeah thats good no?
you can technically do this in js already
yeah you wouldn't be able to use outside variables
createWritable.js: Lines 91-135
onmessage = async evt => {
const port = evt.ports[0]
const cmd = evt.data
switch (cmd.type) {
case 'open': {
const file = cmd.name
let dir = await navigator.storage.getDirectory()
for (const folder of cmd.path) {
dir = await dir.getDirectoryHandle(folder)
}
fileHandle = await dir.getFileHandle(file)
// @ts-ignore
handle = await fileHandle.createSyncAccessHandle()
break
}
case 'write':
handle.write(cmd.data, { at: cmd.position })
handle.flush()
break
case 'truncate':
handle.truncate(cmd.size)
break
case 'abort':
case 'close':
handle.close()
break
}
port.postMessage(0)
}
}
globalThis.FileSystemFileHandle.prototype.createWritable = async function (options) {
// Safari only support writing data in a worker with sync access handle.
if (!workerUrl) {
const stringCode = `(${code.toString()})()`
const blob = new Blob([stringCode], {
type: 'text/javascript'
})
workerUrl = URL.createObjectURL(blob)
}
const worker = new Worker(workerUrl, { type: 'module' })
|| `function runOnThread(thread, func) { return thread.eval("(" + func.toString() + ")()") }; || 
eh oops wrong copy
createWritable.js: Lines 91-135
onmessage = async evt => {
const port = evt.ports[0]
const cmd = evt.data
switch (cmd.type) {
case 'open': {
const file = cmd.name
let dir = await navigator.storage.getDirectory()
for (const folder of cmd.path) {
dir = await dir.getDirectoryHandle(folder)
}
fileHandle = await dir.getFileHandle(file)
// @ts-ignore
handle = await fileHandle.createSyncAccessHandle()
break
}
case 'write':
handle.write(cmd.data, { at: cmd.position })
handle.flush()
break
case 'truncate':
handle.truncate(cmd.size)
break
case 'abort':
case 'close':
handle.close()
break
}
port.postMessage(0)
}
}
globalThis.FileSystemFileHandle.prototype.createWritable = async function (options) {
// Safari only support writing data in a worker with sync access handle.
if (!workerUrl) {
const stringCode = `(${code.toString()})()`
const blob = new Blob([stringCode], {
type: 'text/javascript'
})
workerUrl = URL.createObjectURL(blob)
}
const worker = new Worker(workerUrl, { type: 'module' })
createWritable.js: Lines 88-135
const code = () => {
let fileHandle, handle
onmessage = async evt => {
const port = evt.ports[0]
const cmd = evt.data
switch (cmd.type) {
case 'open': {
const file = cmd.name
let dir = await navigator.storage.getDirectory()
for (const folder of cmd.path) {
dir = await dir.getDirectoryHandle(folder)
}
fileHandle = await dir.getFileHandle(file)
// @ts-ignore
handle = await fileHandle.createSyncAccessHandle()
break
}
case 'write':
handle.write(cmd.data, { at: cmd.position })
handle.flush()
break
case 'truncate':
handle.truncate(cmd.size)
break
case 'abort':
case 'close':
handle.close()
break
}
port.postMessage(0)
}
}
globalThis.FileSystemFileHandle.prototype.createWritable = async function (options) {
// Safari only support writing data in a worker with sync access handle.
if (!workerUrl) {
const stringCode = `(${code.toString()})()`
const blob = new Blob([stringCode], {
type: 'text/javascript'
})
workerUrl = URL.createObjectURL(blob)
}
const worker = new Worker(workerUrl, { type: 'module' })
but its still not really what you're looking for
yeah ofc
because it only rly works for a single thread
not multiple
since it wont sync variables
it's probably never gonna happen
no dude
i swear there was a proposal for it
and it was REALLY good
but i cant find it
and it actually is burning a hole in my brain because i dont rmemeber what it was called
i mean for what it's worth you could do smth like this
runOnThread(
(foo, bar, baz) => { },
[foo, bar, baz]
);
and it would serialise foo bar and baz for you
that's the best you can get rn
JavaScript Structs: Fixed Layout Objects. Contribute to tc39/proposal-structs development by creating an account on GitHub.
maybe it was this?
i'm not sure
this involves workers tho i remember it not involving workers
not a new idea tho
i remember some lib called greensmth that did that
like idk 7 years ago?
damn my memory and temporal coherence is fucking good
|| there's also the opposite of that that makes async functions synchronous ||
oh yeah i know of this too
i think now u can do it with atomics
but there was a hack for it before that
warting originally came up with it iirc
but he took up farming
F
we lost another one
you can cuz i did it
XD
for my webrtc polyfill library for node/deno/bun
its an AWFUL idea
but it works!
i experimented a lot with these things but it always blocks the thread so nothing can be executed including async callbacks
the one i know of achieves it by abusing child_process.execSync, spawning another node process and blocking until it finishes xD
mod.js: Lines 27-31
Atomics.store(int32, 0, 0)
// Send the arguments to the worker thread
localPort.postMessage(args)
// Wait for the worker thread to send the result back
Atomics.wait(int32, 0, 0)
mod.js: Lines 58-60
Atomics.notify(int32, 0)
// Wait for the worker thread to send more data
Atomics.wait(int32, 0, bytesLeft)
thats the non-hacky version
which as u said, blocks main thread
because how else would it work
i forgot you can also use Atomics to send data
There's another way to use them to just wait for exactly 1s
i was only thinking about that
and yeah if you have access to V8, you can use the semaphore to return data from the thread https://github.com/lambci/sync-threads/blob/master/src/index.js#L31
index.js: Line 31
const data = v8.deserialize(Buffer.from(sharedBuffer, INT32_BYTES, length))
the amt of cursed js holds in it
is amazing
lang that trully lets u do anything, without being annoying to work with
grate
EKHEM C
the only other language I can think of that also allows so much cursed shenanigans is Java
yeah, he's from some dutch country iirc
aka the language Javascript was modeled after
so his english is bad
but he's a good guy
took up faming tho
not rly, he took up gardening
if you ever used any open soure library from npm
you used his code
trust me
(referring to people like this who make 3 billion useless packages)
he's fucking everywhere
nah he actually makes insanely cool stuff
streamsaver was big
google used it for ages themselves
before FSA came to be adopted better
he's also the one that showed me u can create node-style http servers in browser via service workers
and 0 hacks
just plain service worker
might be
i dont remember
i talk to dozens of people like that
maybe mathvias was dutch
fairly sure that guy killed himself, he was depressed as fuck and i havent seen him in years
ggz
this guy? https://www.reddit.com/user/mathvias/
he made the first half-decent ebml library for js
which i then took and supercharged
and proceeded to NEVER write docs for it cuz lazy
XD
but its a 0 dependency [outside of buffer cuz i couldnt get uint8 working] version of that using iterators
instead of streams
which makes it like >x2 as fast
oh also @royal nymph if u want smth cursed: https://github.com/ThaUnknown/nzb-file/blob/main/src/index.ts
exposes NTTP article-based files as real-time streamable W3C File objects
NNTP is kinda.... like email... but RSS? its very old
the horror
yeah i do "why the fuck not" code when i'm bored
IWAs now have functional TCP and UDP socket, so i'm gonna be polyfilling node net, dgram and http for them next
XD
had to do:
T extends Function | ProxyMarked ? Remote<T> : T extends object ? Promisify<T> & { [K in keyof T]: RemoteProperty<T[K]>; } : Promisify<T>
but it worked
thanks for the idea
"just promisify it at every step, but also non promisify at every step"
its so dumb, but it works!
do they teach this shit in uni
You will be lucky if you get to learn something else than extends/implements in java /s
my uni taught me how to make a square and rectangle class in java
but they did NOT teach us to extend rectangle
so yeah, above is true
i'm entirely self taught
in the 5 yrs i've been in uni i've not learned anything
except some algebra for a semester that i still dont know how to use
and for 5 years i didnt fail a SINGLE exam
except for last week
where the bitch LOST MY EXAM AND FAILED ME
LIKE WHAT THE FUCK!?
i'm still giga salty about it
it will always amaze me how teachers "lose exams" like you've been teaching for 5 years do you not have the whole "put shit where you wont lose it" thing down?
@supple whale I feel like I've seen you somewhere
yop uni so bad
self learning >>>>>
i've decided to try and learn more about how injecting stuff into webpack works
everything in the bundle im looking at though is inside of an IIFE, and the one variable that does get exposed at the end, webpackChunksle, only has a .push(e,a) method, unlike discord which has a huge array of code chunks and then a push method
and just doing what vencord does with Object.defineProperty doesn't seem to yield anything
i asking vee for help with this awhile back
or if you wanna go more hardcore https://github.com/Vendicated/Vencord/blob/patcher-rewrite/src/webpack/patchWebpack.ts
webtorrent, its dependencies, miru, it's dependencies or random FOSS contributions I needed for the above
it was an online exam, and "it just disappeared"
what kind of incompetence
HOW DO YOU LOSE AN ONLINE EXAM
thats just the teacher hates you and wants to lower your grade
they didnt lose anything, they just glossed over your name
running sudo rm -rf /* on the exam server
DELETE * FROM exams
Is there a specific reason why var was chosen here?
globals.d.ts: Lines 35-44
export var IS_WEB: boolean;
export var IS_EXTENSION: boolean;
export var IS_STANDALONE: boolean;
export var IS_UPDATER_DISABLED: boolean;
export var IS_DEV: boolean;
export var IS_REPORTER: boolean;
export var IS_DISCORD_DESKTOP: boolean;
export var IS_VESKTOP: boolean;
export var VERSION: string;
export var BUILD_TIMESTAMP: number;
otherwise you can't assign them guh
...let?
But they're assigned at a build time
And I haven't seen them changing in the runtime somehow
funny
I think there was a reason I'm not sure honestly
I hope it's something like
Yummy
i wonder if esbuild would inline it if it was used in an assignment
guys i want to implement carousel component, the idea i have is to have overflow on x direction set to hidden and show only the 1 element, then fluently translatex when needed, this is what i have now, but it doesnt seem to work well, the items are shrinked
As seen on LEET HEAT!
https://youtu.be/SlRmQxlg-1I?feature=shared&t=482
Tired of complicated snacks? Check out Deno Nuggies.
who could've guessed that dev branch is not stable
no your plugins are just outdated
lol
UserpluginExploder
xphelper 
theyre globals anyway
so it shouldnt matter right
actually no i forgot this is javascript where nothing ever makes sense
hi
@placid cape imma try rustrover
havent used it in years maybe they made it better than zed
yes very insane
yes I am insane
tailwind 4.0 came out a few days ago and the performance boost is really significant(atleast for me)
oh thats why
im cooked
Authjs is the worst thing ive ever seen
@royal nymph by the way, if you remember the discussion about injecting arbitrary html and css, are you familiar with shadow dom? If so, is there any reason not to use it?
go for it I guess
one thing i noticed is how slow auto-completing is. like i type something and it takes rustrover a few seconds to load the methods, variables, etc. though i'm not sure if it's rustrover's issue or is it just that the project itself is very big
Imagine a blazingly fast react framework built on top of bun
it's good
am i crazy or does jetbrains not register makefiles that dont end with .mk
(you cant select the directory either so its not treating that as a default)
theres probably some setting that you can change
makefiles are not supposed to end in .mk tho do they ?
also i'm pretty sure you can force it in the entension setting stuff
They can
i mean its not enforced or anything
yeak but then if you do make, you have to specify the file
yea it should look only for Makefile
i rather think that .mk files are sort of "extension" files which are then "imported" (by calling e.g. make -F cpp.mk) into the main Makefile
so even if technically you can use any name and extension, having the makefile be named makefile is the intended thing
reading a bit, it seems like .mk is just some informal thing that everyone kinda decided to take as a standard for non-standard makefiles naming or files that extend a makefile by getting included
pretty sure you can tell clion to consider .mk as makefiles
makefile, and Makefile are all used by default for make
make executes commands in the makefile to update one or more targets, where target is typically a program. If no -f option is present, make will look for the makefiles GNUmakefile, makefile, and Makefile, in that order.
Normally you should call your makefile either makefile or Makefile. (We recommend Makefile because it appears prominently near the beginning of a directory listing, right near other important files such as README.) The first name checked, GNUmakefile, is not recommended for most makefiles. You should use this name if you have a makefile that is specific to GNU Make, and will not be understood by other versions of make. If makefile is '-', the standard input is read.
from man make
guhh why is duckduckgo favicon api flop, it returns blank icon for TinEye https://icons.duckduckgo.com/ip3/tineye.com.ico
@ornate quiver @valid jetty did you know about this https://genuary.art/
huskk
unhusk
insane
schizophrenic
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.
How they fell when they do something like this?
God
you're writing javascript, god is already dead
its also really bad at importing
it sometimes imports the wrong path, and some times doesnt suggest an import at all
Peak rust experience
wtf yall doing on rustrover
it works 95% of the time fine for me
even doing cursed stuff
and has been since the EAP
i didn't do anything
i just didn't really notice an immediate benefit
im sure it's probably better if you're writing a lot of rust but i don't
and i don't want to pay for an ide that i just won't be using
zed >>>
fr
I don't see any reason to use jetbrains ide for other langs than java, kotlin, ruby
i'd disagree with java and put python in there
kotlin is unusable outside of jetbrains, ive tried many times
and ruby just doesnt have tooling outside of jetbrains
there are some vscode plugins, but they stop working when u try doing more complex things
so yeah its annoying
fortunately fuck java fuck kotlin never using that shit agane
XD
python???
i can write python in notepad
who needs an ide for python lmao
you can also go write assembly in notepad
so go and do it, take ur weird arguments with ya
yeah but like, python is concise enough to where you dont really need a specialized ide to write code in it
just because you've only written 20loc scripts in python doesnt meant thats true for everyone
its like saying you can do web dev in notepad
sure, noone is gonna do it like that because its not reasonable for anything remotely advanced
rosie is the last person you should be assuming this about
i know, but thats how the argument is presented
which is why it doesnt make sense
idk its arguing for the point of arguing
and i fucking hate that
cursed af JEP
UM AHSHTUALLY TECHNICALLY YOU DONT NEED TO
why not java?
java have a lot of ide's that work outside of jetbrains very well, so its not a necessity
not saying jetbrains ide for java aint good, its just not the only option
i mean, developing spring-like/enterprise apps outside of intellij is pain in ass not gonna lie
even for minecraft development
its purely subjective
but theres a reason 70% of Java devs use intellij
i personally havent had such problems, it worked, so idk
what have you written in java?
like... 2 minecraft mods, an example spring boot app for some uni shit and that's about it
oh and some threading shit
not much
perhaps you worked with things that dont necessarily require intellij
things like database/jpa were for sure pain to use given things like jpa buddy were missing
atleast for me
yeah its possible some libs are developed for intellij, but most of it works outside of it, its possible its better its in intellij
kotlin flat out doesnt work tho outside of intellij, python intellisense and typechecking doesnt either, ruby is also unusable outside of rubymine
is what i mean
I guess
i havent had much problems with python in vscode
kotlin doesnt have a public lsp so its understandable
my friends who write libs for python complained about it A LOT
just use the Python extension on vscode which bundles pylance, or use basedpyright for other editors with lsp support
Java is unusable outside jetbrains
You really don't want gradle/maven/.... project outside intellij
use eclipse
why would you 
if you hate yourself
from experience you'll need to set up CI scripts anyways, so just pasting the maven config into another editor isnt that bad
intellij handling it for you wasnt a good thing for me
but this is very outdated experience for me, idk how it is nowdays
you do need some sort of actual ide
intellisense, language servers, type checking etc is giga important for time saving
stuff like vscode has terrible java support, even with plugins
its not that java is unusable outside of idea, its just that idea is the best tool for it
can’t believe president trump is a rust hater
holy fuck they reinvented by lazy { ... } from kotlin in a worse way
yep
i dont like this whole thing anyways
Wtf is StableValue
new JEP
they should just add
@Lazy annotation
and let it live
they should just develop a brain
I don't think annotations that change fundamental behavior is a good idea
(that's not what happened)
@Override
whitehouse accounts and website are always nuked once president changes so the new president has a clean slate
if you want to find the rust post you need to look it up in the biden archive
A lint does not change fundamental behavior
If you want lazy statics, just stick them in an inner class
its funnier to think trump hates rust
liberal rust propaganda
@Lazy would also not change anything fundamentally
we have annotation processors, quite surprised it hasnt been added yet to something like lombok
I would vote trump if this were true
What would it do then
now now, dont hate rust
idk
its the only language that isnt utterly cancer to compile to WASM
but i doubt it would be anything fundamental
It'd have to rewrite that static and all accesses to it to function calls, or to a hidden inner class

it could probably just hint to the jvm when to initialize it
in a similar manner to how @Override tells the jvm which version of the method should be executed
Yeah "just" add a way to have code that runs on static accesses
jesus, reading this only makes me think "thank fuck i stopped writing java"
It doesn't though. It gives an error if it does not in fact override a method, that's all
yea
guh
nvm then
just a source thing
yea
heres the jep anyways: https://openjdk.org/jeps/502
valhalla will release when im 60
every transfem knows rust so maybe he does
is there any good way to prevent this? I'm using Bun and my friend is using NPM, we always overwrite yarn.lock file(I need it for deployement) any idea how to solve this?
prevent what exactly
make ur friend use bun
Overwriting the yarn lock
why is that just universally true
start*
what
why did i think bun was written in rust
erm its zig actually 🤓
yea
rspack 😭
anything related to js is terrible but if the only way you can feed your family is to use js then bun is the best
idk ask the nefarious crab
crablang reference??
i refuse to use bun
use a normal runtime (node+pnpm)
i mean, i use bun on local, but server uses whatever you give it(prefers to yarn, doesnt support bun). im quite comfortable with bun
sorry i couldnt hear u over the segmentation fault
cuz you likely thought of deno, the superior runtime
Works on my machine
which has v8 bindings written in rust
its peak, standardised high-level API's, full platform independence no matter the architecture, endianness, no compile, low barrier of entry, little to no-restrictions about what u can break, patch or overwrite
there's a lot to like
tell me one other langauge, where you can call bluetooth, and get the SAME result and devices on iOS, android, windows and linux, across arm and x64
because fuck i've not found any outside of js XD
nope
java is kinda... that
except it has a compile step, and no high level api standards
like what W3C does
i like how deno casually implements webgpu
like... what?
XD
and it just fucking... works
LOL
kotlin
same difference
write once run for your life!
duke is coming...

