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
Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

comedyblissoption posted:

also a bunch of the windows development toolchain cannot deal with paths > ~255 characters

I had a .NET project that hit this limitation. curious how visual studio handled this? the answer is not well.

Adbot
ADBOT LOVES YOU

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

tef posted:

this is why python stuffs them into itertools, so that every user list type only need return a generator over implement 30+ methods for each specific type of iteration combination

the STL's way of organizing things never clicked with me until i used python, oddly enough.

cinci zoo sniper
Mar 15, 2013




Xarn posted:

I am paid to code for AWS lambda (that means Python 2.7 only) :v:
you can "hack" your way into python 3 there iirc

Xarn
Jun 26, 2015

cinci zoo sniper posted:

you can "hack" your way into python 3 there iirc

I think Ive even read you can get anything that runs on aws linux in there, but that seems like a good way to get into the terrible programmers/coding horrors threads.

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
This is kind of just bitching apropos of nothing, but as someone just writing janitorial scripts, I find Perl's syntax insanely frustrating. I literally am coding a hobby project in C++14 at home for fun and I find that infinitely more intuitive and readable. What the gently caress is this poo poo?
@{${hashOfTurds{$turdKey}}}

I know what it does, of course. The fact that there's a parade of alternate ways to say that is, if anything, a strike against the language. It is just bizarre to me that someone would be interested in making a language that reads so terribly.

Cybernetic Vermin
Apr 18, 2005

perl really should be understood in its historic context though, it amalgamated a lot of existing stuff (awk, sed, bourne shell stuff) and can be argued as being first in its category

much like python3000 the perl6 thing makes no sense whatsoever, since no one used perl with a clean slate and all options open, it was always a bit of a bucket of legacy stuff which is great if you are trying to do something already mired in legacy unix'y string mangling and cpan dependencies

MSPain
Jul 14, 2006
if you think of perl as the lower UTF-8 characters combined with mandarin chinese it makes a lot more sense.

Cybernetic Vermin
Apr 18, 2005

this complaining requires the reposting of the vandor xml parser of kx k, used in production, all a very serious language of little hobbyist interest (our own Internet Janitor aside): https://a.kx.com/a/k/examples/xml.k

a lot of k looks like that

Bulgogi Hoagie
Jun 1, 2012

We

Cybernetic Vermin posted:

this complaining requires the reposting of the vandor xml parser of kx k, used in production, all a very serious language of little hobbyist interest (our own Internet Janitor aside): https://a.kx.com/a/k/examples/xml.k

a lot of k looks like that

jesus christ

Shaggar
Apr 26, 2006

Cybernetic Vermin posted:

this complaining requires the reposting of the vandor xml parser of kx k, used in production, all a very serious language of little hobbyist interest (our own Internet Janitor aside): https://a.kx.com/a/k/examples/xml.k

a lot of k looks like that

is that perl ?

Cybernetic Vermin
Apr 18, 2005

no, kx k, an apl descendant used primarily in the financial industry

JewKiller 3000
Nov 28, 2006

by Lowtax
any recommendations for books or online resources for a 14 year old learning programming with javascript? something less heavy than a college intro textbook, but not patronizing stuff for kids either? i just read reference manuals and api docs these days, i'm not sure where to point a new programmer. i'm guessing something online/interactive that guides you toward proper software development, where you actually understand what's going on and not just copy-paste the magic, but without getting too formal about things

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news

JewKiller 3000 posted:

any recommendations for books or online resources for a 14 year old learning programming with javascript? something less heavy than a college intro textbook, but not patronizing stuff for kids either? i just read reference manuals and api docs these days, i'm not sure where to point a new programmer. i'm guessing something online/interactive that guides you toward proper software development, where you actually understand what's going on and not just copy-paste the magic, but without getting too formal about things

whjy are you posting in the POS if you are fourteen??!!!

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
also teach them python not js :cmon:

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Cybernetic Vermin posted:

no, kx k, an apl descendant used primarily in the financial industry

why would anyone ever use that

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
js is cool to teach kids because it's right there in the browser and that's l337 as poo poo

mystes
May 31, 2006

K is similar to J, which seems to be primarily motivated by a concern that APL was too readable.

Cybernetic Vermin
Apr 18, 2005

fart simpson posted:

why would anyone ever use that

very fast, deeply integrated with an in-memory (or mmapped disk) database (from k4 on tables are a first-class type, behaving as both an array of records and a map from the key to the record), very straightforward ipc

also it is way easier to learn and work with than appearances suggest: the way simple type/data model (and a functional style) makes understanding interfaces easy, there are a lot of operators but their use and the syntax is very orthogonal. the tendency is to use the trivial ipc and insane compactness to keep each service very small, keeping most of it right in front of your eyes a lot of the time

i mean, if i ran a company i wouldn't have anyone write k (cumbersome java for all, everywhere), but i personally really enjoy it and it has some interesting points

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Cybernetic Vermin posted:

very straightforward

um ok ill take your word for it

Athas
Aug 6, 2007

fuck that joker

fart simpson posted:

why would anyone ever use that

APL is super expressive.

K is said to be fast, but I haven't been able to figure out why (except that the interpreter is tiny).

JawnV6
Jul 4, 2004

So hot ...

Arcsech posted:

which means lots of context-switching which fucks your cache (which is important for heavy-duty number crunching type libs)

distortion park
Apr 25, 2011


Athas posted:

APL is super expressive.

K is said to be fast, but I haven't been able to figure out why (except that the interpreter is tiny).

its all in memory columnstore, which e.g. sql server has only gained recently. it's also really optimised for write only time series use case i think

MrMoo
Sep 14, 2000

K's performance with CSV files is impressively bad. The column store is more of a gimmick for time series data, there are many instances when KDB is just not good at all.

Athas
Aug 6, 2007

fuck that joker

pointsofdata posted:

its all in memory columnstore, which e.g. sql server has only gained recently. it's also really optimised for write only time series use case i think

Fortran stores arrays column-major, even when it was still called FORTRAN. Maybe my problem is that I'm coming at this from functional high-performance-computing, where things like loop fusion are the key, and K is more about good IO performance.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

JewKiller 3000 posted:

any recommendations for books or online resources for a 14 year old learning programming with javascript? something less heavy than a college intro textbook, but not patronizing stuff for kids either? i just read reference manuals and api docs these days, i'm not sure where to point a new programmer. i'm guessing something online/interactive that guides you toward proper software development, where you actually understand what's going on and not just copy-paste the magic, but without getting too formal about things

I dunno, I've seen the results of stuff like https://nodeschool.io and other js resources and been rather underwhelmed with the approach they take, way too much glossing over things to get to the practical results, that they almost implicitly assume someone is going to fill in the fundamentals. and for some people the fundamentals are of critical importance.

that said, I'm a big fan of How to design Programs -- http://www.ccs.neu.edu/home/matthias/HtDP2e/part_prologue.html -- but I'm unsure whether that straddles the balance you're looking for correctly. Simply working through the prologue with Dr. Racket should be beneficial for the fundamentals, I feel it does a pretty decent job of explaining itself and the concepts.

Cybernetic Vermin
Apr 18, 2005

Athas posted:

Fortran stores arrays column-major, even when it was still called FORTRAN. Maybe my problem is that I'm coming at this from functional high-performance-computing, where things like loop fusion are the key, and K is more about good IO performance.

nah, the only actual io that is quick in k is memory mapping tables (maps of vectors). the guy complaining about csv performance above is not wrong, it is not its forte at all to fiddle around in arbitrarily formatted files

the basic performance case for k is not that it is ever winning an apples-to-apples comparison, where you go all-out vector libraries in some other language. it has a ton of operators though, all on vectors by default, many seemingly very powerful, but largely all very quick and tightly implemented. the same with the library (the sql dialect maps very thinly onto a few powerful operators which you can freely use yourself on vectors) and overall practices. is the case pretty much everywhere, stuff like the ipc is very raw the-standard-representation-onto-the-wire-in-tight-c stuff for example. so more about always getting the "apples" version of the program as long as you don't go out of your way to mess stuff up

the interpreter being tiny may also help, but in the typical k program the interpreter is going to be executing relatively few operations compared to the number of cpu ops they represent

it may now sound like it is mostly like just using every numpy op you can find when writing python, but the operators/library/runtime are more flexible (or, rather, more convenient to use in a flexible way), making it easier to e.g. do symbolic stuff or seemingly branch-heavy tasks

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
If anyone's genuinely curious about K, I suppose it might be appropriate to plug the APL/J/K thread again.

As of a few months ago I'm actually a professional K programmer now. At the company I work for it's used for everything from deployment automation and expression parsing to web scripting and distributed databases. Even after spending some time wading through and cleaning up real-world K codebases, warts and all, it remains one of my favorite languages. Though it may seem implausible, it does become quite readable with practice. When you're used to K, more conventional languages often feel needlessly verbose and clumsy.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Internet Janitor posted:

If anyone's genuinely curious about K, I suppose it might be appropriate to plug the APL/J/K thread again.

As of a few months ago I'm actually a professional K programmer now. At the company I work for it's used for everything from deployment automation and expression parsing to web scripting and distributed databases. Even after spending some time wading through and cleaning up real-world K codebases, warts and all, it remains one of my favorite languages. Though it may seem implausible, it does become quite readable with practice. When you're used to K, more conventional languages often feel needlessly verbose and clumsy.

code:
/ xml: (tag;data|xml+;(attr;value)*)  dtd: element(,|?+*) attlist entity

\d .xml
L:"<";W:"\t\r\n",B:" ";S:"/";R:">";cut:{:[#y;(#x)_'(y _ss x)_ y:x,y;()]};join:{(#x)_(0#x),/x,/:y}

oc:1!";&#",_ci 48+8 8 8 _vs*_ic	/ octal from char, e.g. oc"a"
co:_ci,8 _sv -48+_ic 3_-1!	/ char from octal, e.g. co"&#141;"
xc:_ssr/[;"&<>'",,"[\200-\377]";("&amp;";"&lt;";"&gt;";"&apos;";oc)]	/ xml from char
cx:_ssr/[;("&amp;";"&lt;";"&gt;";"&apos;";"&#???;");"&<>'",co]		/ char from xml

ex:{(&b&1=+\(b&:~e)-(c&1!R=x)|e:(b:L=x)&1!c:S=x)_ x} / element from xml
/ (s;v[;a]) from xml
dx:{a:(-S=*|a)_ a:(1+m:s?B)_ s:_ssr/[;W;B](n:x?R)#x;x:(-m+1)_(*i)_(*|i:&~x _lin W)#x:(1+n)_ x
 (`$1_ m#s;:[L=*x;_f'ex x;cx x]),:[~#a@:&0<#:'a:cut[B]a;a;,{(`$n#x;-1_(2+n:x?"=")_ x)}'a]}

/ xml from (s;v[;a])
xd:{s:$*x;L,s,:[2=#x;"";,/B,'{($*x),"='",(*|x),"'"}'x 2],:[#v:x 1;R,:[4:v:x 1;xc v;,/_f'v],L,S,s;S],R}

indent:{s:1+y?R;e:-1-(|y)?L;:[~L=*t:s _ e _ y;,x,y;(,x,s#y),(,/_f[B,x]'ex t),,x,e#y]}[""]
DX:{dx@,/x@&~(x:(&b&1=+\(b:x=L)-x=R)_ x)[;1]_lin"?!"}
XD:join["\n"](,"<?xml version='1.0' encoding='UTF-8'?>"),indent xd@

xd d:dx x:"<g><f a='2'/><h>34</h><i b='3' c='asdf'>asdf</i></g>"
DX XD d
\

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

fart simpson posted:

code:
/ xml: (tag;data|xml+;(attr;value)*)  dtd: element(,|?+*) attlist entity

\d .xml
L:"<";W:"\t\r\n",B:" ";S:"/";R:">";cut:{:[#y;(#x)_'(y _ss x)_ y:x,y;()]};join:{(#x)_(0#x),/x,/:y}

oc:1!";&#",_ci 48+8 8 8 _vs*_ic	/ octal from char, e.g. oc"a"
co:_ci,8 _sv -48+_ic 3_-1!	/ char from octal, e.g. co"&#141;"
xc:_ssr/[;"&<>'",,"[\200-\377]";("&amp;";"&lt;";"&gt;";"&apos;";oc)]	/ xml from char
cx:_ssr/[;("&amp;";"&lt;";"&gt;";"&apos;";"&#???;");"&<>'",co]		/ char from xml

ex:{(&b&1=+\(b&:~e)-(c&1!R=x)|e:(b:L=x)&1!c:S=x)_ x} / element from xml
/ (s;v[;a]) from xml
dx:{a:(-S=*|a)_ a:(1+m:s?B)_ s:_ssr/[;W;B](n:x?R)#x;x:(-m+1)_(*i)_(*|i:&~x _lin W)#x:(1+n)_ x
 (`$1_ m#s;:[L=*x;_f'ex x;cx x]),:[~#a@:&0<#:'a:cut[B]a;a;,{(`$n#x;-1_(2+n:x?"=")_ x)}'a]}

/ xml from (s;v[;a])
xd:{s:$*x;L,s,:[2=#x;"";,/B,'{($*x),"='",(*|x),"'"}'x 2],:[#v:x 1;R,:[4:v:x 1;xc v;,/_f'v],L,S,s;S],R}

indent:{s:1+y?R;e:-1-(|y)?L;:[~L=*t:s _ e _ y;,x,y;(,x,s#y),(,/_f[B,x]'ex t),,x,e#y]}[""]
DX:{dx@,/x@&~(x:(&b&1=+\(b:x=L)-x=R)_ x)[;1]_lin"?!"}
XD:join["\n"](,"<?xml version='1.0' encoding='UTF-8'?>"),indent xd@

xd d:dx x:"<g><f a='2'/><h>34</h><i b='3' c='asdf'>asdf</i></g>"
DX XD d
\

i mean, people poo poo on me for being able to read idiomatic mumps too, but when you do it all day it really is natural. mr janitor has literally read and written so much k i imagine he could bang out most interview questions in a few minutes in it.

mekkanare
Sep 12, 2008
We have detected you are using ad blocking software.

Please add us to your whitelist to view this content.
K is cool and good and fun, although I barely got far in it, so maybe I left it at the honeymoon phase.
IJ was also very helpful in answering my questions and everyone should give the language a shot.
:wave:

MononcQc
May 29, 2007

Do I need to be a fancy maths person to use a language like K ?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
so the go community is combusting because they decided to add something like aliases to the language:

https://github.com/golang/proposal/blob/master/design/16339-alias-decls.md

(an example in practice):
https://go-review.googlesource.com/#/c/32145/1/draw/go1_8.go

quote:

I find this unreadable and confusing. One of the biggest benefits of Go for me has been its amazingly simple syntax and readability. Adding aliases with a new operator "=>" adds a layer of indirection and confusion that is unnecessary to the language. I find this change very disappointing, especially after the continued reassurance in the original proposal that it was only for certain critical edge cases.

yes, more even one layer of indirection is unnecessary and confusing and impossible to understand. rob pike has spawned a community even more insane than he is.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

MononcQc posted:

Do I need to be a fancy maths person to use a language like K ?

Nope. I mean look at me; I'm just a janitor.

K is a simple, very regular functional programming language with well-thought-out behaviors.

For example, applying a function and indexing a list uses the same syntax:
code:
  "ABCDEF"[3]
"D"

  {2*x}[7]
14
This helps you notice a deep parallel between slicing arbitrary dimensioned arrays and currying functions:
code:
  m: (1 2 3;4 5 6)
(1 2 3
 4 5 6)

  m[;2]
3 6

  m[1;]
4 5 6

  m[0]
1 2 3
  
  f:{x+2*y}
{[x;y]x+2*y}

  f[1]
{[x;y]x+2*y}[1;]

  f[;2]
{[x;y]x+2*y}[;2]

  f[;2][9]
13
Common operations get symbols. / is like reduce, \ is like accumulate, ' is like map, and so on. Symbols are overloaded for unary and binary cases, which often have some mnemonic relationship. For example, unary # gets the count of a list, and binary # reshapes a list into a specified dimension:
code:
  #2 5 17 12
4

  3#2 5 17 12
2 5 17

  4 3#2 5 17 12
(2 5 17
 12 2 5
 17 12 2
 5 17 12)
The selection of primitive operators include very useful, powerful tools. Unary < is grade-up; producing a list of indices by which you could index the original list to sort them ascending according to their natural ordering. Unary = is group; produce a dictionary mapping items in a list to lists of the indices at which they can be found. Grading a dictionary sorts the keys by the values. Here's a point-free k6 fragment which finds the element of a list that occurs most frequently:
code:
  v: 10?4
1 2 2 3 2 1 2 2 2 3

  =v
1 2 3!(0 5
 1 2 4 6 7 8
 3 9)

  #:'=v
1 2 3!2 6 2

  >#:'=v
2 3 1

  *>#:'=v
2
Literally, "The first of the grade-down of the count of each group of the vector v."

K isn't going to be for everyone, and it doesn't shine for every problem domain, but it is eminently learnable and teaches a nice way of thinking about solving problems. Programming in K makes me very happy, and I hope more people give it an honest try.

sarehu
Apr 20, 2007

(call/cc call/cc)

MALE SHOEGAZE posted:

yes, more even one layer of indirection is unnecessary and confusing and impossible to understand. rob pike has spawned a community even more insane than he is.

Rob Pike is smarter than you.

Corla Plankun
May 8, 2007

improve the lives of everyone

MALE SHOEGAZE posted:

so the go community is combusting because they decided to add something like aliases to the language:

https://github.com/golang/proposal/blob/master/design/16339-alias-decls.md

(an example in practice):
https://go-review.googlesource.com/#/c/32145/1/draw/go1_8.go


yes, more even one layer of indirection is unnecessary and confusing and impossible to understand. rob pike has spawned a community even more insane than he is.

is this like how ruby dumps garbage into the global namespace on import or is this a different thing?

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

MALE SHOEGAZE posted:

so the go community is combusting because they decided to add something like aliases to the language:

https://github.com/golang/proposal/blob/master/design/16339-alias-decls.md

(an example in practice):
https://go-review.googlesource.com/#/c/32145/1/draw/go1_8.go


yes, more even one layer of indirection is unnecessary and confusing and impossible to understand. rob pike has spawned a community even more insane than he is.

Ah, so it's a way to maintain API/ABI stability when changing the implementation of a package to split its backend out into modules.
No wonder golangers are throwing a poo poo-fit, their approach to stability is to copy the version you depend on into your project.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Corla Plankun posted:

is this like how ruby dumps garbage into the global namespace on import or is this a different thing?

I'll reply later if no one else does.

sarehu posted:

Rob Pike is smarter than you.

absolutely, but he's still nuts

Volte
Oct 4, 2004

woosh woosh
rob pike wrote a bunch of text editors nobody has ever used, a bunch of poo poo for an operating system nobody has ever used, and most of it is from the 90s or before. my opinions of him are formed on the stuff he's done that I've actually used (i.e. golang, which is decent but still feels like a 1970s do-over) and the words he's said (which range from sensible to controversial to ridiculous, much like pretty much anyone). but people still hang on his opinions and argue against syntax highlighting because rob did, and argue against type systems and generics and exceptions because rob did. as if peoples' own opinions and experiences get superseded by rob pike's. is it because they associate him with K&R? he reminds me of crockford in some ways.

Carthag Tuek
Oct 15, 2005

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



the practice of programming is a pretty good book imo

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Corla Plankun posted:

is this like how ruby dumps garbage into the global namespace on import or is this a different thing?

So yah, honestly: It's exactly what it says it is. Go doesn't have aliases. Some identifiers will let you bind a variable to them, and you can export those (constants), but in most cases it's treated as a different thing.

This is usually fine, but it's troublesome with types, because the type system uses type identity for checking, so if I have a function that takes foo.Bar as an argument, I HAVE to use the Bar from package foo. Which again isn't a big deal for small projects, but if you want to organize your project with say, one public package that exports a bunch of private things, you're mostly out of luck.

I think there are deeper implications for things like vendoring, but I'm not enough of a go expert to really go into it.

It's just amusing to watch the go community lose its poo poo over a pretty minor (and needed, IMO) addition to the language. You reap what you sow.

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