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.
 
  • Locked thread
cinci zoo sniper
Mar 15, 2013




Valeyard posted:

this reminds me that pandas is still on version like 0.2 and still heavily in production use lol

on atomic level, core pandas functionality - the data storage - is based primary on numpy arrays, which are like 25 years old and were originally written by dude who later made both jython and ironpython (same single guy). now pandas api though, well, uhh, yeah, it is what it is and i dont envy you too much

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




i mean its a bit fallacious to call whatever major version of numpy arrays we are on rn (3 or 4, maybe even more) to be the same old good thing, but you get the point. numpy is a know good quality, has C api, etc

Glorgnole
Oct 23, 2012

numpy's good as hell

in contrast eigen's docs actually have to say "no you cannot easily slice arrays here, sorry"

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
stop doing heavy numerical computational work in python. just stop. it's wrong, you're wrong, everything you're doing is wrong WRONG WRONG

Valeyard
Mar 30, 2012


Grimey Drawer
i know people that use pandas just because it has a to_json() function lol

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

DELETE CASCADE posted:

stop doing heavy numerical computational work in python. just stop. it's wrong, you're wrong, everything you're doing is wrong WRONG WRONG

lol this guy

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

Glorgnole posted:

numpy's good as hell

in contrast eigen's docs actually have to say "no you cannot easily slice arrays here, sorry"

true as hell, good as hell
the non-tensorial matrix poo poo can go kill itself tho
.dot all the way

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
blah blah blah "it's a C library so really the actual work isn't done in python!!!" i don't loving care, if you are writing a complicated enough program that you need these libraries, then you should get as far away from python and other garbage p-langs as you can, as fast as you can. it's only going to get worse, not better

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

DELETE CASCADE posted:

blah blah blah "it's a C library so really the actual work isn't done in python!!!" i don't loving care, if you are writing a complicated enough program that you need these libraries, then you should get as far away from python and other garbage p-langs as you can, as fast as you can. it's only going to get worse, not better

Acting like the numerical stuff in non p langs is worth a poo poo in any lang except Fortran

Lol working in Fortran

Luigi Thirty
Apr 30, 2006

Emergency confection port.

so I got gambit installed since it was like the only lisp/scheme/whatever i could find that actually works on WSL (SBCL crashes due to something in /proc missing, the rest just crash on startup) and i've got most of a wavefront obj -> binary data script together

i bet there's a more idiomatic way to do this lol

code:
(define convert-mesh-to-32bit-fixed
  (lambda (mesh)
    (map
     (lambda (triangle)
       (map
	(lambda (vertex)
	  (map
	   (lambda (coordinate)
	     (convert-to-32bit-fixed coordinate))
	   vertex))
	triangle))
     mesh)))
works though

Mao Zedong Thot
Oct 16, 2008


I actually want to do some numeric stuff soon, and am seriously considering Fortran. Technically it was the first programming language I used, but uhh I was like 10 and mostly my dad was telling me what to type. What could possibly go wrong?

Mao Zedong Thot
Oct 16, 2008


If not J which I know passably well enough.... :frogsiren:

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

Mao Zedong Thot posted:

I actually want to do some numeric stuff soon, and am seriously considering Fortran. Technically it was the first programming language I used, but uhh I was like 10 and mostly my dad was telling me what to type. What could possibly go wrong?

Lol working in Fortran

(What specific numeric poo poo are ya doing)

Valeyard
Mar 30, 2012


Grimey Drawer

Luigi Thirty posted:

so I got gambit installed since it was like the only lisp/scheme/whatever i could find that actually works on WSL (SBCL crashes due to something in /proc missing, the rest just crash on startup) and i've got most of a wavefront obj -> binary data script together

i bet there's a more idiomatic way to do this lol

code:
(define convert-mesh-to-32bit-fixed
  (lambda (mesh)
    (map
     (lambda (triangle)
       (map
	(lambda (vertex)
	  (map
	   (lambda (coordinate)
	     (convert-to-32bit-fixed coordinate))
	   vertex))
	triangle))
     mesh)))

works though

i dont know much about what you are doing, but i know that it is bad!!!

Glorgnole
Oct 23, 2012

DELETE CASCADE posted:

stop doing heavy numerical computational work in python. just stop. it's wrong, you're wrong, everything you're doing is wrong WRONG WRONG

i will not desist, in fact i will continue to do it

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Mao Zedong Thot posted:

I actually want to do some numeric stuff soon, and am seriously considering Fortran. Technically it was the first programming language I used, but uhh I was like 10 and mostly my dad was telling me what to type. What could possibly go wrong?

it kinda depends what you mean by numeric stuff. if you're dealing with something where the hardware costs become a serious issue, then sure maybe doing some fortran and c sprinkled with some delicious assembler might make sense and save you some time, and thus cash, in the end. but even then most numerical stuff reduces to well known algorithms, and optimized versions already exist for most of those. you'll probably also want to make sure whatever you use has gpu support, because it's a no-brainer for a lot of numerical code these days

Mao Zedong Thot
Oct 16, 2008


Just hobby loving around with finance. Zero need for fast processing or efficiency. Just looking for a 'fun' change of pace, otherwise I'd do it in go :riker:

Anybody using modern Fortran? Is it a horrorshow?

cinci zoo sniper
Mar 15, 2013




DELETE CASCADE posted:

stop doing heavy numerical computational work in python. just stop. it's wrong, you're wrong, everything you're doing is wrong WRONG WRONG

DELETE CASCADE posted:

blah blah blah "it's a C library so really the actual work isn't done in python!!!" i don't loving care, if you are writing a complicated enough program that you need these libraries, then you should get as far away from python and other garbage p-langs as you can, as fast as you can. it's only going to get worse, not better

u mad dog

Valeyard posted:

i know people that use pandas just because it has a to_json() function lol

i use it in our homegrown "database flusher" because it was fastest to shitcode a table update mindful of autoincrementing p-keys

cinci zoo sniper
Mar 15, 2013




Mao Zedong Thot posted:

Just hobby loving around with finance. Zero need for fast processing or efficiency. Just looking for a 'fun' change of pace, otherwise I'd do it in go :riker:

Anybody using modern Fortran? Is it a horrorshow?

i wouldnt be surprised if less people did modern fortran than modern cobol. there's very little reason to use it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

fortran is basically used in either legacy code or on supercomputers doing physics simulations

brap
Aug 23, 2004

Grimey Drawer

Luigi Thirty posted:

so I got gambit installed since it was like the only lisp/scheme/whatever i could find that actually works on WSL (SBCL crashes due to something in /proc missing, the rest just crash on startup) and i've got most of a wavefront obj -> binary data script together

i bet there's a more idiomatic way to do this lol

code:
(define convert-mesh-to-32bit-fixed
  (lambda (mesh)
    (map
     (lambda (triangle)
       (map
	(lambda (vertex)
	  (map
	   (lambda (coordinate)
	     (convert-to-32bit-fixed coordinate))
	   vertex))
	triangle))
     mesh)))
works though

lisp is so loving unreadable

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?

Luigi Thirty posted:

so I got gambit installed since it was like the only lisp/scheme/whatever i could find that actually works on WSL (SBCL crashes due to something in /proc missing, the rest just crash on startup) and i've got most of a wavefront obj -> binary data script together

i bet there's a more idiomatic way to do this lol

code:
(define convert-mesh-to-32bit-fixed
  (lambda (mesh)
    (map
     (lambda (triangle)
       (map
	(lambda (vertex)
	  (map
	   (lambda (coordinate)
	     (convert-to-32bit-fixed coordinate))
	   vertex))
	triangle))
     mesh)))
works though

you don’t need the outermost lambda, you can define a function directly—there, one level of indentation saved, ship it

honestly though it looks pretty idiomatic to me, in that it represents a bunch of stream processing; maybe pull the (lambda (arg) up to the same line as the (map to maybe match more common coding style

the Lisp (though not necessarily Scheme) way might be to define a few macros that take a stream and a body to apply to it, which applies it repeatedly to make a new stream; it reduces to the same thing but makes the code look more like this:

code:
(defun convert-mesh-to-32bit-fixed (mesh)
  (with-triangles mesh (triangle)
    (with-vertices triangle (vertex)
      (with-coordinates vertex (coordinate)
        (convert-to-32bit-fixed coordinate)))))
then you can use those same macros to do other things to triangles, vertices, etc.

the advantage of the Scheme you wrote over this is that there’s no implicit accumulators so you could make it work on a lazy (pull) stream as easily as a complete list

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?

brap posted:

lisp is so loving unreadable

nah, though formatting can make a difference

code:
(define (convert-mesh-to-32bit-fixed mesh)
  (map (lambda (triangle)
         (map (lambda (vertex)
                (map (lambda (coordinate)
                       (convert-to-32bit-fixed coordinate))
                     vertex))
              triangle))
       mesh))
identical to what she posted except it explicitly makes convert-mesh-to-32bit-fixed a function and indents the lambda and the stream to which it’s applied at the same level

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?
a real Lisper would do it all via the loop macro which is its own entire semi-infix procedural sublanguage full of mystery and wonder, that gets its own entire chapter in CLtL

comedyblissoption
Mar 15, 2006

the loop macro is an abomination upon the lord

prefer chaining higher order functions together. lisp's syntax makes this harder to read than it should be though because you have to read inside out

Luigi Thirty
Apr 30, 2006

Emergency confection port.

well here's what I came up anyway with as an occasional lisper and a first-time schemer. it does the needful, converting the mesh from an .obj file from my modeler into an include file for my 68k assembler. it has some warts but it works!

https://pastebin.com/MQSr8DRk

brap
Aug 23, 2004

Grimey Drawer
I wrote a decent amount of racket code when I was first learning programming and wouldn’t discourage others from doing the same. sooner or later, though, you realize that a language where the first thing that happens in the program is always at the center of an onion of parentheses is just painful.

Doom Mathematic
Sep 2, 2008

Mao Zedong Thot posted:

I was like 10 and mostly my dad was telling me what to type.

Pair programming :3:

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

Mao Zedong Thot posted:

Just hobby loving around with finance. Zero need for fast processing or efficiency. Just looking for a 'fun' change of pace, otherwise I'd do it in go :riker:

Anybody using modern Fortran? Is it a horrorshow?

On the subject of lisps, try julia

AWWNAW
Dec 30, 2008

does that lisp not have a threading macro like Clojure and if not, why?

Workaday Wizard
Oct 23, 2009

by Pragmatica
julia (https://julialang.org/) is a lisp?

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

AWWNAW posted:

does that lisp not have a threading macro like Clojure and if not, why?

You're talking about Clojure's -> and ->>? should be pretty easy* to write, if the answer is no.

*not much harder than writing any appropriately hygienic macro for the lisp in question

Sapozhnik
Jan 2, 2005

Nap Ghost

DELETE CASCADE posted:

blah blah blah "it's a C library so really the actual work isn't done in python!!!" i don't loving care, if you are writing a complicated enough program that you need these libraries, then you should get as far away from python and other garbage p-langs as you can, as fast as you can. it's only going to get worse, not better

eat poo poo and die, fucker

numerical code is non-programmer code and dear god i would rather deal with non-programmer python than non-programmer literally any other language

if you really gotta make it sanic then that's what cython is for

JawnV6
Jul 4, 2004

So hot ...
i write c and will go blue in the face defending it but ugh writing huge data shoveling in it, just use pythong

especially for quick prototypes? experiments? nothing like ipython notebooks

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

It supports macros and you are expected to use the macros lol

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?

bob dobbs is dead posted:

On the subject of lisps, try julia

gross, it has syntax

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

DELETE CASCADE posted:

blah blah blah "it's a C library so really the actual work isn't done in python!!!" i don't loving care, if you are writing a complicated enough program that you need these libraries, then you should get as far away from python and other garbage p-langs as you can, as fast as you can. it's only going to get worse, not better

30 TO 50 FERAL HOG
Mar 2, 2005




lol

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Mao Zedong Thot posted:

I actually want to do some numeric stuff soon, and am seriously considering Fortran. Technically it was the first programming language I used, but uhh I was like 10 and mostly my dad was telling me what to type. What could possibly go wrong?

I started my career as a professional terrible programmer with fortran and to be honest it's... fine. I mean Fortran 90, not Fortran 77. dealing with f77 legacy code was a nightmare lol.

it's a way more straightforward language than C, if you have a hardon for it I say go for it. just make sure you understand floating point numbers well and the way fortran does arrays.

it's been a while since I touched fortran seriously though, because every numeric problem that I stumble upon I just prototype a half-assed solution in python/numpy and it's always been good enough.

Adbot
ADBOT LOVES YOU

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Why load css in .css format? self.javascript

Submitted 5 hours ago by vmajsuk

Hey folks, I've got some idea and I can't see why it is stupid, so you help me please

Basically, why not load css in .js file? Storing css in strings with format like protobuf, maybe just simply use 'p' instead of 'padding', for example, and loading it together with a simple function that restores css based on these strings and appends it to the document.head seems like a huge win for the overall bundle size.

  • Locked thread