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
echinopsis
Apr 13, 2004

by Fluffdaddy
:qqsay:

Adbot
ADBOT LOVES YOU

echinopsis
Apr 13, 2004

by Fluffdaddy
all good lol spose I misunderstood this thread :cry:

MononcQc
May 29, 2007

echinopsis posted:

doesn’t pl just mean programming language not plang?

yeah but the thread is mostly programming language enthusiasts/nerds discussing the intricacies and implications of specific concepts and their implementations. Like it’s often about languages themselves rather than using them.

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?

echinopsis posted:

I really wish I can learn to use something like a dictionary.

dictionaries are absolutely a thing in all sorts of languages and if the language doesn’t have the concept natively there are always simple implementations available

JavaScript has them baked in and they’re the same as JavaScript’s objects

JavaScript code:
// create a dictionary with one name-value pair
var dict = {
    "name" : "value";
};

// change the value at "name"
dict["name"] = "another value";

// add a value, which happens to be a dictionary
dict["nested"] = {
    "nestedName" : "another value";
 };

// remove the entry at "nested"
delete dict.nested;

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?
we don’t really need new programming languages since the best language, Lisp, has existed for 63 years now

the only remaining question is whether one should use a Lisp-2 or a Lisp-1

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
the main footgun to be aware of with using js objects as maps is that keys are always coerced to strings

this ends up being just fine in many situations, though. for example, the default string cast of an array like [2,3] in js is "2,3"; distinct arrays of ints still have distinct string representations, so if you consistently used 2-element arrays of ints as keys into an object it would "just work" so long as you never tried to iterate over the keys of the object, or whatever

redleader
Aug 18, 2005

Engage according to operational parameters
js also has Map, which works exactly like you'd expect a dictionary to work in every other lang

redleader
Aug 18, 2005

Engage according to operational parameters

Internet Janitor posted:

the main footgun to be aware of with using js objects as maps is that keys are always coerced to strings

this ends up being just fine in many situations, though. for example, the default string cast of an array like [2,3] in js is "2,3"; distinct arrays of ints still have distinct string representations, so if you consistently used 2-element arrays of ints as keys into an object it would "just work" so long as you never tried to iterate over the keys of the object, or whatever

oh yeah this one's great because it turns up juuuust infrequently enough that i forget it, then am surprised

neosloth
Sep 5, 2013

Professional Procrastinator
if you use anything except a string or a symbol (in a good plang) as a key you deserve to fail

Achmed Jones
Oct 16, 2004



neosloth posted:

if you use anything except a string or a symbol (in a good plang) as a key you deserve to fail

:hmmno:

Cybernetic Vermin
Apr 18, 2005

neosloth posted:

if you use anything except a string or a symbol (in a good plang) as a key you deserve to fail

and yet you index your arrays with integers hmmm?

neosloth
Sep 5, 2013

Professional Procrastinator

Cybernetic Vermin posted:

and yet you index your arrays with integers hmmm?

whats an array

Cybernetic Vermin
Apr 18, 2005

either way the "lets just have everything act as a string" is certainly a popular classic, used by absolute idiot clowns (e.g. shell scripting and javascript maps) and in one single instance consistently enough that it has some value, i.e. tcl, so i will be polite enough to assume you're just a tcl'er.

FlapYoJacks
Feb 12, 2009

neosloth posted:

if you use anything except a string or a symbol (in a good plang) as a key you deserve to fail

shart[💨] = 💩

FlapYoJacks fucked around with this message at 06:55 on Sep 22, 2023

Pythagoras a trois
Feb 19, 2004

I have a lot of points to make and I will make them later.

echinopsis posted:

button index was like the primary reference, as in, button index refers to the id of the button but also the crime associated with the button. its the primary variable passed around everywhere that lets the program know what button/crime I am dealing with

I don't know anything about javascript or your code, I just liked that there's a 'commitcrime' function. Good function name.

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

eschaton posted:

we don’t really need new programming languages since the best language, Lisp, has existed for 63 years now

the only remaining question is whether one should use a Lisp-2 or a Lisp-1

I'll just use C, which has been determined as better than lisp by working programmers for over 50 years.

Kazinsal
Dec 13, 2011


c in 2023 is about trying to find the best combo of vendor extensions to make what you really want to do easy to write

source: have written several thousand lines of c that only work if you pass -fms-extensions to gcc because implementing pseudo-inheritance for device drivers would require tens of thousands more lines of code without -fms-extensions

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

Kazinsal posted:

c in 2023 is about trying to find the best combo of vendor extensions to make what you really want to do easy to write

source: have written several thousand lines of c that only work if you pass -fms-extensions to gcc because implementing pseudo-inheritance for device drivers would require tens of thousands more lines of code without -fms-extensions

I mostly work with compilers from the 90s-early2000s

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
If you're not writing portable code are you even living?

Kazinsal
Dec 13, 2011


leper khan posted:

I mostly work with compilers from the 90s-early2000s

I would simply fake my death and move to belize

echinopsis
Apr 13, 2004

by Fluffdaddy

neosloth posted:

whats an array

just a long string

echinopsis
Apr 13, 2004

by Fluffdaddy

Kazinsal posted:

I would simply fake my death and move to belize

:worship:

echinopsis
Apr 13, 2004

by Fluffdaddy
nm

echinopsis fucked around with this message at 14:11 on Sep 22, 2023

echinopsis
Apr 13, 2004

by Fluffdaddy

RokosCockatrice posted:

I don't know anything about javascript or your code, I just liked that there's a 'commitcrime' function. Good function name.

I will never regret living life to the full

redleader
Aug 18, 2005

Engage according to operational parameters

echinopsis posted:

just a long string

:hai:

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

yeah but the thread is mostly programming language enthusiasts/nerds discussing the intricacies and implications of specific concepts and their implementations. Like it’s often about languages themselves rather than using them.

this thread slapfights about checked exceptions, and the other thread is where we complain about programming

Dijkstracula
Mar 18, 2003

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

leper khan posted:

I mostly work with compilers from the 90s-early2000s

I work with gcc-13 in a big bed with my wife

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
If anyone knows why the toshiba T900 compiler is hard crashing in windows xp on me, or why it can't run in anything newer than that I'd appreciate knowing tia.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

leper khan posted:

If anyone knows why the toshiba T900 compiler is hard crashing in windows xp on me, or why it can't run in anything newer than that I'd appreciate knowing tia.

i dont know about that

Athas
Aug 6, 2007

fuck that joker

leper khan posted:

If anyone knows why the toshiba T900 compiler is hard crashing in windows xp on me, or why it can't run in anything newer than that I'd appreciate knowing tia.

I hope your company has a 30 hour work week or pays extremely well.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Athas posted:

I hope your company has a 30 hour work week or pays extremely well.

why? that’s a transferable skill

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

Athas posted:

I hope your company has a 30 hour work week or pays extremely well.

Neither, but that project is what I do for fun on the weekends.

Bloody
Mar 3, 2013

rjmccall posted:

i am happy that echi wants to learn to program but there really is an entire subforum for this

is that not yospos???

Bloody
Mar 3, 2013

Cybernetic Vermin posted:

either way the "lets just have everything act as a string" is certainly a popular classic, used by absolute idiot clowns (e.g. shell scripting and javascript maps) and in one single instance consistently enough that it has some value, i.e. tcl, so i will be polite enough to assume you're just a tcl'er.

powers hell uses objects :smugdog:

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



tef posted:

this thread slapfights about checked exceptions, and the other thread is where we complain about programming

yep

this is where i come to read yall effort post about esoterica like that, exceptions, threads, types etc

the terrible programming thread is where i come to post about the fuckin javascript & php i have to maintain being pieces of poo poo

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Bloody posted:

powers hell uses objects :smugdog:

most of the time i like this

Cybernetic Vermin
Apr 18, 2005

yeah, in principle i think it is vastly better.

though really a shell needs native table datatypes. lilsh when internet janitor?!

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
i mean, lilt does have the ability to shell out to subprocesses

i don't think anyone would want to use it to completely replace their usual shell but i use it to write shebang scripts all the time

Cybernetic Vermin
Apr 18, 2005

and honestly the value would be in rewriting a million utilities that logically output tables to actually output tables. though possibly one could be parasitic on some powershell stuff for that

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
lil's basic toolkit includes both proper csv parsing/formatting and a pretty flexible facility for cracking apart fixed-width or other delimited-column formats, so it can interact easily with cli tools that speak in text-as-tables

but lil strings do not support unicode, which limits some practical applications, and of course lil is orders of magnitude slower than grep/awk/sed/sqlite for their intended purposes

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