Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Torch is so fucking good, and once you get used to the data science stuff, Jupyter notebooks are incredibly useful. I did a whole semester of labs using Jupyter and I was very efficient
I'm of two minds about Jupyter. The editing components themselves are not very good and you can get things about state confused fairly easily (mitigated by just running things from the top whenever necessary). There is no way to work on Jupyter Notebooks in Vim (and there is what looks like equivocal support in Emacs, but it seems a bit fishy) so you are basically stuck with an inferior editor. On the other hand, I really like the idea of literate programming esp. when there are a lot of things in data science and the associated tooling that are tricky and it's nice to have documentation for what you were doing earlier with executable code embedded directly therein. Notebooks are also the default and best supported way to use certain platforms like Kaggle and Google Colab. So I was very late to get on the Jupyter train but I don't regret having done so now.
oh yeah did you know perl is a lisp too
Yes
python is not even a lisp, maybe it's a bit of a smalltalk or something (idk smalltalk)
Ruby is a far better contender for "Smalltalk, but more popular" than Python
maybe op doesn't want to do data science, there are other things to do on computers than just crunch numbers
Data science was just one example; there are many many many others
 
On the other hand, I really like the idea of literate programming esp. when there are a lot of things in data science and the associated tooling that are tricky and it's nice to have documentation for what you were doing earlier with executable code embedded directly therein.
i was looking through the org mode manual and it can do literate programming stuff apparently
Ruby is a far better contender for "Smalltalk, but more popular" than Python
yes python isn't even a good smalltalk clone either
Data science was just one example; there are many many many others
i hate this "my language has more library therefore it better"
if you followed that to its conclusion it would be apparent that bash is the best programming language because you can just shell out to anything you want right?
 
i hate this "my language has more library therefore it better"
It's an entirely practical consideration; not every comparison can be "other things being equal"
i hate this "my language has more library therefore it better"
if you followed that to its conclusion it would be apparent that bash is the best programming language because you can just shell out to anything you want right?
Let me know when bash has an FFI that allows all the things that numpy can do
 
Let me know when bash has an FFI that allows all the things that numpy can do
i'm not too much of a linear algebra statistic data science nigger and i might be missing some important numpy feature but i think "bash numpy" would be sort of like the netpbm utilities except instead of a bunch of tools that transform ppm files, it's a bunch of tools that transform binary files made up of a small header and a fuckton of floats
you could even embed a small dsl into it like ffmpeg has with its filters if you wanted to use it without wanting to kill yourself
and with smart usage of certain operating system functions, this could actually run at speeds in the "moderately usable" territory

and yes it would probably be extremely retarded when you could use python with numpy (as much as i hate the python language, it's significantly less retarded than the shell) but i think the lack of good linear algebra libraries in many languages is mainly due to people not caring enough to write all the required c wrappers, so they just use the least retarded language that has a good wrapper

also this made me think: what if gpu virtual file systems were a thing? all of the memory buffers on the gpu being files would be very based and unixpilled
 
i'm not too much of a linear algebra statistic data science nigger and i might be missing some important numpy feature but i think "bash numpy" would be sort of like the netpbm utilities except instead of a bunch of tools that transform ppm files, it's a bunch of tools that transform binary files made up of a small header and a fuckton of floats
You came very close to describing something that does in fact exist:
I'm a bit leery of doing things this way. Cleaning data using this approach has to be hell.
 
You came very close to describing something that does in fact exist:
https://www.mlpack.org/doc/quickstart/cli.html
this seems a bit higher-level than what i thought of (seems to be for "i need to train a classifier on this random csv file i have NOW" and not "i want to mangle these float buffers to implement my sick deep neural network idea") but it has the general idea going there (i think)
I'm a bit leery of doing things this way. Cleaning data using this approach has to be hell.
i think there could be many decent ways to inject very special custom logic into this kind of thing without wanting to kill yourself
at the very worst you would have to write a program in the language of your choice to parse the float buffer and do what you need to do
 
i think there could be many decent ways to inject very special custom logic into this kind of thing without wanting to kill yourself
at the very worst you would have to write a program in the language of your choice to parse the float buffer and do what you need to do
Python and R (haven't used Julia yet) have very sophisticated means of doing all the mundane but vital cleaning and preparation tasks that are believed to constitute about 80% of machine learning. I would want to kms if I had to start from scratch.
 
Python and R (haven't used Julia yet) have very sophisticated means of doing all the mundane but vital cleaning and preparation tasks that are believed to constitute about 80% of machine learning. I would want to kms if I had to start from scratch.
if everything was autistically split up, you could do shit like use a perl script for a few problems then a python script for some fucked up dates and then do god knows what in r
it's just interesting to thunk about
 
if everything was autistically split up, you could do shit like use a perl script for a few problems then a python script for some fucked up dates and then do god knows what in r
That strikes me as being insanely brittle and unwieldy. Of course I would want a bunch of sequential operations on the data but with the same representation and functionality throughout. R is kind of nice in this regard as it has a functional pipe operator (originally %>% via magrittr and now standard via |>).
 
Show me a Perl script that can do PCA or convolutions on data with a few lines of code. Scientific computing does require a robust library because having to hack together a program just to test a given hypothesis is asinine. The purpose of SC libraries is to save you hours on the blackboard, to allow processing AND manipulation of the data to be done quickly
 
I don't know about Perl 5 but conceivably Ruby or Raku could do that sort of code golf. Whether you would want to is another matter.
Exactly, the libraries exist and are able to perform the task. That’s not even getting into the fact that the numpy and friends ecosystem is widely adopted and taught in universities
I don’t have to debug my implementation of a clustering algorithm, I can just import it and apply the parameters.
A lot of analyzing a new dataset is trying like 10 approaches until something clicks, it requires being able to iterate quickly, because the primary focus is the data, the mathematics, and the hypothesis
 
Show me a Perl script that can do PCA or convolutions on data with a few lines of code.
perl doesn't have the tools to do that
its main use imo would be to unfuck a really mangled csv if you had to
if the "netpbm of linear algebra" existed, you could use that from perl

you obviously aren't focused on programming itself here though, you just want to use it as a vehicle for expressing math which is fine and you should probably use r or whatever
the newbie this horrible conversation started with seems to just want to learn programming which doesn't mean he wants to learn your extremely specific subfield of programming that uses languages that are widely laughed at by the people in other areas

i still stand by my earlier assertion that python as a language by itself isn't exceptionally great, and people only use it because it looked like a good idea a couple of decades ago and now it's entrenched because it has a bunch of easy-to-access libraries
this kind of thing mainly just makes me sad, and i don't think it's fixable
 
Exactly, the libraries exist and are able to perform the task. That’s not even getting into the fact that the numpy and friends ecosystem is widely adopted and taught in universities
I get what you're saying but I meant that Ruby and Raku, with better number support (in particular, Ruby has a built-in Matrix class) could probably do some of sorts of things you mentioned in a very bespoke code golf sort of way but that wouldn't really be desirable. For one thing, being put into practice it would be really fucking slooow.
the newbie this horrible conversation started with seems to just want to learn programming which doesn't mean he wants to learn your extremely specific subfield of programming that uses languages that are widely laughed at by the people in other areas
  • For said newbie using Guile or another Lisp would likely count as its own extremely specific subfield
  • Python and R aren't really widely laughed at notwithstanding their various warts
 
For said newbie using Guile or another Lisp would likely count as its own extremely specific subfield
except any good generalist programmer needs to learn a little lisp at some point
this is a hard requirement btw
also any good programmer will be familiar with any programming language from python to lisp to c to x64 assembler and be able to use them if necessary
it is mostly optional to be extremely salty when ecosystem problems make languages you hate necessary
notwithstanding their various warts
every language has warts but those languages seem to be all warts
i hope one day python is viewed in a similar light as basic: fun to write shitty programs in and sometimes extremely useful but also severely brain damaged
 
I have a notion to hack together a primitive vi in Guile to vaguely mog on Emacs never adopting Guile. I don't use that many esoteric vi features or anything. Basic is fine for me. What editors do y'all use? I know nvim is popular here. Do you regularly use its odder features?
 
I have a notion to hack together a primitive vi in Guile to vaguely mog on Emacs never adopting Guile. I don't use that many esoteric vi features or anything. Basic is fine for me. What editors do y'all use? I know nvim is popular here. Do you regularly use its odder features?
What would be "odder features"? I personally like nvim due to Lua being used for config and LSP being native.
My plugins are nvim-tree, cmp and nvim-lspcofnig. Other than that I use patterns, mostly for substitute, and ofc motions.
Being able to just ci' or da( is like my most beloved feature of anything.
 
any good generalist programmer needs to learn a little lisp at some point
Yes, it's the class you take in college that tells you about all the languages you'll never use to make money. I'm not saying it's not good to know they exist, but you likely won't be seeing them ever again unless you need the skill to dunk on people on the Internet.

Python, for better or worse, is today's glue language. It's not bad from a programming point of view, it gets the job done, has the familiar control and loop flow and function syntax to every other common language.

I'm working on one of those "Write something that you want to write" projects right now and Python is pissing me off about the string vs byte stuff. Yes, I know my data has random unicode and random high-ascii and other assorted garbage, just shut up and stick it in the database. It's a nested deduplication tool, so it not only looks at the file hash, but for zip,7z,rar,chd, etc it goes in and hashes the content too so I can figure out how many TB of my "retro" game and computer stuff is really duplicates. But the filenames are also "retro" and sometimes don't obey the holy unicode laws. Maybe I should have just written it in C where everything can be a uint8[].
 
I have a notion to hack together a primitive vi in Guile to vaguely mog on Emacs never adopting Guile. I don't use that many esoteric vi features or anything. Basic is fine for me. What editors do y'all use? I know nvim is popular here. Do you regularly use its odder features?
honestly i use neovim for mini.move so i can move lines around and shit and because i got used to vim keybinds
other than that an oil.nvim i pretty much use stock neovim/vim features
 
Back
Top Bottom