Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

akadajet posted:

in javascript you simply call Function.prototype.toString() then use an npm hosted library to parse the function you're "reflecting" on

eBay, I believe, used to call toString on functions and then change them with regexes and recompile them, at page-load time. it was very fragile. I still hate them for it

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

Subjunctive posted:

gonna watch this during my ketamine infusion today, thanks

always found a poo poo ton of weed the right way to read cs papers, personally

akadajet
Sep 14, 2003

Subjunctive posted:

eBay, I believe, used to call toString on functions and then change them with regexes and recompile them, at page-load time. it was very fragile. I still hate them for it

I've seen toString being used to turn multi-line comments into multi-line strings before javascript supported that

akadajet fucked around with this message at 16:43 on Sep 9, 2023

akadajet
Sep 14, 2003

susan b buffering posted:

this is why automapper drives me nuts

automapper is such loving bullshit I hate it

tef
May 30, 2004

-> some l-system crap ->
kinda aside but i've been learning about compact data structures and now i'm itching for an excuse to use them, all because of this paper

http://groups.di.unipi.it/~ottavian/files/semi_index_cikm.pdf

it's a "semi index", or a compressed json parse tree

there's a compressed array of file offsets, and a bit vector to represent the parse tree (also compressed), and supports most of the operations you'd expect on a json streaming parser. the idea is that the semi index is much much smaller in memory, can be paged out to disk, but still allows efficient navigation through the structure.

i have some json i need to parse where i have to unseralize it twice, once to get a "kind" field, and then again for that particular type. it's slow, but it works

it's stupidly tempting to overengineer a solution where i parse json into a compressed index, then use that without having to deserialize the entire thing twice

mystes
May 31, 2006

Shaggar posted:

if you dont have types then theres nothing to reflect on
your life choices

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
I’d love to read some papers, but I can’t even find papers for subjects I’m dealing with that aren’t 30 years old. no idea how to find papers. none.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Sweeper posted:

I’d love to read some papers, but I can’t even find papers for subjects I’m dealing with that aren’t 30 years old. no idea how to find papers. none.

sites like google scholar can help you find what subsequent papers cite those 30 year old ones

also research is cyclical and a lot of stuff that was hot 30 years ago isn’t an area of research anymore (“multimedia technologies” were second only to p2p networking protocols in the 90s and ain’t nobody touching that stuff today) so if you aren’t finding recent work there might be a reason

toiletbrush
May 17, 2010

akadajet posted:

automapper is such loving bullshit I hate it
automapper sucks enormously but its still better than 'magic' mapping using C#s implicit operator

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

tef posted:

parsing papers deserve a special shoutout



don’t mock us, this is just a frame from the opening of “Neon Genesis Evangelion"

Buck Turgidson
Feb 6, 2011

𓀬𓀠𓀟𓀡𓀢𓀣𓀤𓀥𓀞𓀬

abraham linksys posted:

if reading papers is so important maybe they shouldnt all be formatted as two column pdfs that are annoying as gently caress to read on a computer or phone

also they should be written in language me, a college dropout, can understand. none of these drat weird symbols either. dont know how im supposed to just remember what poo poo the half-life logo means in computers

They should publish papers in HTML

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Buck Turgidson posted:

They should publish papers in HTML

there's a push for this which looks great but who knows how it'll take

the cool thing about nota is that you can build in hyperlinks and click-to-learn-more stuff which is great for the aforementioned inscrutable greek symbols in a PL paper problem

redleader
Aug 18, 2005

Engage according to operational parameters

tef posted:

parsing papers deserve a special shoutout



this is REAL computer science written by REAL programmers

they have played us for absolute fools

Winty
Sep 22, 2007

is there any good C++ IDE. for linux. that will let me jump to definition, refactor rename basic things like that?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Winty posted:

is there any good C++ IDE. for linux. that will let me jump to definition, refactor rename basic things like that?

CLion?

VikingofRock
Aug 24, 2008




Winty posted:

is there any good C++ IDE. for linux. that will let me jump to definition, refactor rename basic things like that?

Anything with some sort of LSP integration should work with clangd.

I use (neo)vim because I am a masochist

Voodoo Cafe
Jul 19, 2004
"You got, uhh, Holden Caulfield in there, man?"

Winty posted:

is there any good C++ IDE. for linux. that will let me jump to definition, refactor rename basic things like that?

if it's for work, get your employer to pay for CLion, lsp+clangd+vscode is decent but clion is better

if it's for personal use, reconsider what missteps in your life have brought you to ask this question

VikingofRock
Aug 24, 2008




So after reading yet another blog post about async Rust, I started wondering -- when is async actually the right abstraction to reach for? Instead of something like rayon's scope, or crossbeam's various queues and channels, I mean. It seems like async is useful for servers that are doing a zillion things at once, but why do other abstractions fall short there?

M31
Jun 12, 2012
async rust is good for sabotaging your project/company. unlike the other solutions you mentioned, it's good at making everybody miserable

mystes
May 31, 2006

VikingofRock posted:

So after reading yet another blog post about async Rust, I started wondering -- when is async actually the right abstraction to reach for? Instead of something like rayon's scope, or crossbeam's various queues and channels, I mean. It seems like async is useful for servers that are doing a zillion things at once, but why do other abstractions fall short there?
We're not quite to the point where literally every language has async support so it's still not quite time for everyone to agree that it's bad and decide that green threads or whatever are the new hotness again

Maybe once go gets it

mystes fucked around with this message at 07:29 on Sep 10, 2023

Soricidus
Oct 21, 2010
freedom-hating statist shill

mystes posted:

We're not quite to the point where literally every language has async support so it's still not quite time for everyone to agree that it's bad and decide that green threads or whatever are the new hotness again

Maybe once go gets it

java already decided to skip async and is reintroducing green threads in the next lts release in a few days. hopefully this will help lead the industry back into the light.

Dijkstracula posted:

the cool thing about nota is that you can build in hyperlinks and click-to-learn-more stuff which is great for the aforementioned inscrutable greek symbols in a PL paper problem



why do they bother with the symbolic mess when they clearly know how to achieve the same effect using their words?

Grum
May 7, 2007
on average they don't. if everyone writes using the same formalism communication becomes possible. remarkable

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Soricidus posted:

why do they bother with the symbolic mess when they clearly know how to achieve the same effect using their words?

because at heart these are still math papers

Cybernetic Vermin
Apr 18, 2005

Soricidus posted:

why do they bother with the symbolic mess when they clearly know how to achieve the same effect using their words?

ancient greeks invented the field of logic without using symbols, then followed basically 2000 years of squabbling about grammar (syllogism nonsense where books were written about how to differentiate between the category "man" and any particular person) before symbols were introduced and progress got infinitely faster

crazypenguin
Mar 9, 2005
nothing witty here, move along

VikingofRock posted:

So after reading yet another blog post about async Rust, I started wondering -- when is async actually the right abstraction to reach for? Instead of something like rayon's scope, or crossbeam's various queues and channels, I mean. It seems like async is useful for servers that are doing a zillion things at once, but why do other abstractions fall short there?

everyone memes about "concurrency vs parallelism" but that's the actual answer.

Got asynchronous, non-deterministic events to handle? (i.e. concurrency?) async

Got lots of computation to do? (i.e. parallelism?) threads

(Anytime you have parallelism, you fundamentally have concurrency to deal with too, but libraries like rayon have some good abstractions for hiding that sometimes.)

So it's not just servers (where you've got lots of incoming requests, but also have to submit and wait for responses from downstream services), it's anything doing a lot of "orchestration." There's a good blog post on why cargo-nextest uses tokio, for example.

Async Rust is in a bit of bad place because:

1. It's legit unfinished. There's another year of polishing work that needs doing here. Still, it's good enough for the common cases (e.g. web service where all state lives in external databases)
(1b. There are a number of footguns, but I consider this part of the unfinishedness. I think these are fixable...)
2. There's something to actually learn here. Like borrow checking, you need to learn something legit new and it takes time and effort. But unlike borrow checking where you either learn it or things don't work, with async Rust you can not learn it but stumble your way to code that sorta works but badly, instead.
3. People are pathological about running into a problem and patching/hacking/working around as fast as they can, instead of pausing to go "oh poo poo, did I design this wrong?" and this is a road to absolute hell combined with the above two problems. In particular, a lot of "async Rust bad" takes seems to be someone in this situation, where they complain bitterly about some problem and people in the comments are like "what? why are you trying to do that??"

It usually goes a lot better when there's an expert on the team. Which, might be tautological, but I mean it takes just one, it's not "everyone has to be an expert" like a lot of C++ problems...

tef
May 30, 2004

-> some l-system crap ->

VikingofRock posted:

So after reading yet another blog post about async Rust, I started wondering -- when is async actually the right abstraction to reach for? Instead of something like rayon's scope, or crossbeam's various queues and channels, I mean. It seems like async is useful for servers that are doing a zillion things at once, but why do other abstractions fall short there?

"Are Threads Better Than Events?" - the greatest thread in the history of forums, locked by a moderator after 12,239 pages of heated debate,

tef
May 30, 2004

-> some l-system crap ->

Dijkstracula posted:

because at heart these are still math papers

"we learned it from watching you" huh

tef
May 30, 2004

-> some l-system crap ->
"when is async actually the right abstraction to reach for?"

forgive me for not writing a blog post sized answer here, but there's really only two "simple" answers here

- when it's your only option for concurrency
- when you're ok with cooperative multithreading, but frankly preemptive threads exist for a reason
- when you're absolutely sure no-one will accidentally put a blocking call in somewhere

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
if you start with a language that has no notions of concurrency, you can use an asynchronous programming style in combination with a top-level event pump to tackle concurrent problems while making no fundamental changes to the language

node and its offshoots heavily emphasize async, because javascript demanded it

i think at least some node developers (and other scripting-languages-for-infrastructure communities) never wrapped their brain around why they were programming in that style, and assumed that async everywhere, all the time, is an intrinsically enlightened approach

Cybernetic Vermin
Apr 18, 2005

specifically cooperative green thread concurrency is also real easy to design in a way where there are no surprises. or rather the surprises have all have easy to explain causes.

erlang has its dna in that camp as well, and it is not incompetence that landed it there.

akadajet
Sep 14, 2003

async await owns and lol if ur language doesn’t have it

akadajet
Sep 14, 2003

I don’t know what a “green thread” is. sounds dumb and bad

Athas
Aug 6, 2007

fuck that joker
I thought people were being ironic when they complained about PL theory papers using notation, but now I'm not so sure. Also:

crazypenguin posted:

(Anytime you have parallelism, you fundamentally have concurrency to deal with too, but libraries like rayon have some good abstractions for hiding that sometimes.)

:actually: depending on how fundamental you go, there are parallel programming models that don't have observable concurrency at all, e.g. APL or even SIMD instructions to an extent. Most data parallelism is not really concurrent.

pseudorandom name
May 6, 2007

akadajet posted:

I don’t know what a “green thread” is. sounds dumb and bad

green threads are the thing that everybody added to their threading APIs in the early 1990s because they were the future and then took them out because they weren't the future

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

tef posted:

- when you're ok with cooperative multithreading, but frankly preemptive threads exist for a reason

cooperative multitasking is a lot easier to reason about than preemption. you don’t have to worry about flaky data races due to unexpected preemption points, because your preemption points are all explicit, if not necessarily syntactic

can save a lot of thinking about locking and memory fences and so forth with a cooperative model, assuming people really do cooperate. I often wished for a nice way to do it in C++ back when I was doing browsers, though with more modern languages (including the last decade of C++, I think?) the ergonomics of thread-safety are certainly much nicer than hoping everything you’re targeting is covered by Rogue Wave

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

green threads are making a comeback now that people want to be able to switch “flows of control” without taking a syscall in overhead. they’re great because your toy program will run N% faster but now you have to worry about improper blocking calls choking a set of threads and all the joy that comes from freely racing data accesses

Cybernetic Vermin
Apr 18, 2005

now, hear me out, it was too early last time i now know, but with hybrid functional having matured and all this async being in: call-with-current-continuation.

Cybernetic Vermin
Apr 18, 2005

Subjunctive posted:

green threads are making a comeback now that people want to be able to switch “flows of control” without taking a syscall in overhead. they’re great because your toy program will run N% faster but now you have to worry about improper blocking calls choking a set of threads and all the joy that comes from freely racing data accesses

it is kind of a general evolution as well, where i think there is now for most programmers a (proper) differentiation where if there is a call that'd take more than x ms (for a very small x) without doing io then probably it should be known and designed around as a "complex" component. e.g. an async point where actual threads get properly designed in.

the original green thread efforts were comparatively extremely half-baked, often operating on platforms where there were a million trap doors that broke them. some of the new ones surely are as well, but here's where nodejs is actually good, and erlang always was.

pseudorandom name
May 6, 2007

lol Microsoft removed their new green threads support from Windows

https://learn.microsoft.com/en-us/windows/win32/procthread/user-mode-scheduling

Adbot
ADBOT LOVES YOU

Cybernetic Vermin
Apr 18, 2005


......i have no idea what color threads that was, but os support for green threads seems an oxymoron

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply