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
Cybernetic Vermin
Apr 18, 2005

Python is poo poo, but numpy is awesome enough to make up for its shortcomings, making it possible to work with sane types and get some performance.

Adbot
ADBOT LOVES YOU

Cybernetic Vermin
Apr 18, 2005

gucci void main posted:

use non-blocking, asynchronous code with node.js

all code is fast when wrapped in sufficiently many closures

Cybernetic Vermin
Apr 18, 2005

haskell is poo poo don't use it

(sdl is awesome fyi)

Cybernetic Vermin
Apr 18, 2005

the funny part about Haskell is that normal people quickly get the gut feel that the monad poo poo is a stupid spergy invention, but are then shown that category theory is a real mathematical field and are persuaded that there is something to it

the problem is that they don't realize that mathematicians doing category theory are spergy idiots wasting their own and everyone elses time

Cybernetic Vermin
Apr 18, 2005

Suspicious Dish posted:

the name is an oxymoron

it says "simple" and then it has "directmedia' "layer"

that poo poo aint simple

making up words to make acronyms sound nice is simpler than you think

Cybernetic Vermin
Apr 18, 2005

Zombywuf posted:

Your mistake is assuming Haskell has anything more to do with category theory than any other language. Haskell programmers just feel smug that they noticed that one of their constructs can be described with category theory. Everything can be described with category theory.

you are just restating what I was saying, category theory is stupid, among other things because it is overly general to the point where it doesn't allow anything of interest to be gainfully expressed

haskell suffers from a similar problem of similar origins, with complex language features to enable things to be expressed in a weird way for no appreciable gain

Cybernetic Vermin
Apr 18, 2005

Zombywuf posted:

Natural transformations. Not interesting. Got it.

right, happy you have learned something.

Cybernetic Vermin
Apr 18, 2005

yaoi prophet posted:

graph theory??? when the hell am i going to need this stuff, it's just things connected to things

this is the stupidest comparison ever on the internet

Cybernetic Vermin
Apr 18, 2005

had a week-long period where I had to get up every morning to insert a replacement stored procedure into a production database by pasting a specially crafted url into an internet explorer instance before business open.

couldn't just log in and patch it properly since there was a release procedure to comply with first.

Cybernetic Vermin
Apr 18, 2005

kx kdb+, or q, is the only language worth knowing

all hail arthur

Cybernetic Vermin
Apr 18, 2005

Formal verification is pretty cool stuff but can only be very narrowly applied (provably so, since it overlaps immediately with complexity theory). On the other hand controlling side-effects is still pretty much where things are (successfully) going, which makes many things more tractable, both verification and enabling things like universal transactional code.

A bridge being safe does not rely on every bolt in the bridge being perfect, it relies on a larger framework of redundancy, which is hard to achieve in code unless one can achieve proper separation of concerns.

Cybernetic Vermin
Apr 18, 2005

MeruFM posted:

Engineering reliability of real world parts seems very different than software reliability.
To some extent you are looking at the reliability problem from the wrong perspective. Take email, it is an incredibly lovely old crufty system, but it is one where it is well understood how to make emails either safely delivered or fail in a manageable way. As long as you have appropriately solid secondary storage and a reasonable implementation of the specifications and intents of the specifications email really does work, despite being a system with excessively many individually flawed cooperating components. Basically the real engineering amounts to the decision about who is responsible for the mail, and some best practices on how the responsibility should be handled.

As noted before, bridges are not safe because they are made out of beams and bolts that are individually perfect, they are safe because the larger structure is designed taking flaws into account.

Formal verification in the small, trying to take assembly and verify its correctness, is rightly an increasingly dead field of research. Even if perfect programs are written random cosmic radiation will still cause unpredictable errors now and then. Instead system interactions are studied, doing things like designing protocols where it is ensured that any global error states are transient, or that certain operation sequences are impossible, and so on. It is also pretty fun stuff, where raw code verification was always a bit Quixotic stuff like handling byzantine failures in distributed state machines and such all seems relatively manageable.

Cybernetic Vermin
Apr 18, 2005

a way way way underused trick in programming languages is using reference counting and allowing mutating only objects with a reference count equal to 1, all other mutations are copy-on-write

reference counting only has two issues; it is expensive and it requires acyclic data structures. the above already enforces all data being acyclic, and various language design tricks, such as proper vector support, encourages sufficiently large objects that efficiency can be maintained

i only know of one language that does this, and the guy that designed it is mad rich now.

Cybernetic Vermin
Apr 18, 2005

the java standard library is pretty rigid and depressing when used in any modestly more dynamic language than java

lisp failing certainly has nothing to do with a lack of quality implementations at any rate, one of the few languages where one is genuinely spoiled with tons of fine implementations

Cybernetic Vermin
Apr 18, 2005

i am not a web guy and needed a web proxy to intercept some http and rewrite headers and serve alternatives for some gets and nginx made it real easy to do that where the apache documentation filled me with despair

pretty ok with nginx idk

Cybernetic Vermin
Apr 18, 2005

lets also not forget that one of the many features perl, python and ruby all share is hilariously bad interpreters

the pragmatism that made perl an eminently practical language also made the interpreter awful, and anyone actually believing that these were the people to trust to write a new vm to end all other vms must have been a bit confused

Cybernetic Vermin
Apr 18, 2005

rust is genuinely interesting stuff

Cybernetic Vermin
Apr 18, 2005

FamDav posted:

so rust is the compromise that nobody wanted?

popular appeal is a poor metric, people want lovely things like mongodb mugs

Notorious b.s.d. posted:

presenting a uniform set of abstractions across operating systems that sometimes lack concepts like "files" or "processes" is a much taller order than clojure<=>jvm interop, and the results were predictably messy

CL was an ill-conceived idea that completely failed, but was still a really solid engineering effort. it is really way better than the average present-day lisp idiot ("hey, lets write another blogpost about macro hygiene rather than every writing any useful code ever!") deserves

Cybernetic Vermin
Apr 18, 2005

Toady posted:

i came across this, and it sure seems like tcl is actually good, so why have i always heard that it's poo poo? will people mock me if i embed tcl in 2013 and expose it as a scripting API to users? tia

being small and consistent is not all there is to being good, but for dsls, commandlines and configurations tcl is pretty awesome

i think the hate arises to some part from people encountering tcl in large-scale roles it is a poor fit for

Cybernetic Vermin
Apr 18, 2005

the only correct "everything-is-a"-datatype is the table

Cybernetic Vermin
Apr 18, 2005

nothing more pleasant in the world then tossing in a tcl instance to act as an interactive shell for your complex server though

can start out just calling jmx/equivalent methods if you like, then add convenience commands over time, and maybe pop up a little tk window to visualize more complex return values, and it is all convenient and flexible

also beanshell is awful

Cybernetic Vermin
Apr 18, 2005

much google guice for all

this thread is filthy

Cybernetic Vermin
Apr 18, 2005

Mr Dog posted:

There are conservative GCs, you can't get a real GC because the C++ type system is optional.

all GC is conservative, the question whether a piece of memory will ever be used again is undecidable

Cybernetic Vermin
Apr 18, 2005

otoh many things are an issue when you have real time constraints

Cybernetic Vermin
Apr 18, 2005

i sort of said this spread out across a couple of posts, but reference counting plus everything-is-a-table is a neat language model. only reference count on the table level, and encourage large tables rather than a billion atomic objects floating around. combines beautifully with column-orientation

basically kx k/q is the holy land for scaling

Cybernetic Vermin
Apr 18, 2005

webgl is such a ridiculous idea. lucky google got distracted by the madness of nacl instead

Cybernetic Vermin
Apr 18, 2005

THC posted:

nerds always get mad when I tell people that Java is a good first PL. certainly I agree that, like most computing platforms, the java platform is horrible garbage largely due to mismanagement by its parent company, Oracle. but it is a good entry point to programming imo.

and just cause someone learns programming in java doesnt obviate them using java in the future.

am I a bastard for thinking this? my first compiled language was C

having taught on introductory programming languages for a couple of years my experience is: java and c both work great for different reasons, python does not work as well as one would expect

relatively primitive operations are helpful for understanding. for example the ugly old C for-loop is perfectly pedagogical and can quickly be fully understood in all its parts, whereas the python for-loop is a constant problem, with students being confused about lists and sequences, often confusing the range idiom with fixed syntax, etc.

it is also a lot harder than one thinks to teach language subsets unless the subsets are very cleanly separable, and both c and java work out reasonably well there

Cybernetic Vermin
Apr 18, 2005

also the python block indentation style is hugely annoying for programming beginners since they will spend a lot of time experimenting with small changes and maintaining correct indentation is not really a good use of their time at that point.

plus of course the python maintainers are retarded and has the interpreter error out if you use a character outside of the range 0-127 in a source file without a #coding: comment at the top, including inside comments. of course this used to work, but the python maintainers feel that things working is a bad goal to have so they added some extra code to make sure that the average students program stops running with an obtuse error message and a reference to a PEP when they are commenting and happen to insert an ä.

i am angry irl now and i am not even doing the python course this year

Cybernetic Vermin
Apr 18, 2005

Mr Dog posted:

Teaching algorithms and data structures in C is good, having programmers write their very first programs in some non-awful asm (i.e. not x86) is better, maybe even hand-assemble an instruction or two.

The closer their mental model of a computer is to "a machine made of many simple parts" and the further away it is from "an incomprehensible mystic construct you chant memorised spells at" the better

the python course is to a great part for people like economics students and such though, where it is not so much a foundation for a deep understanding of programming as it is practice for stringing things together in some tools they use. even then though python does not work out all that well, the complex fundamental building blocks distract from getting the mental model necessary to structure a program. i don't think that java really gives a clear idea of how the computer works, but it is conceptually simpler

a more funny aspect that we easily solve though is that in python the students often get a very confused idea that they are supposed to learn the library, and feel that they are doing something wrong when they are solving a task by actual programming rather than doing a sequence of library calls v:shobon:v

Cybernetic Vermin
Apr 18, 2005

closures being awesome does little to save javascript from being awful

Cybernetic Vermin
Apr 18, 2005

imagine an alternative universe where brendan eich invented closures and were even more insufferable~~

Cybernetic Vermin
Apr 18, 2005

brendan? is that you?

Cybernetic Vermin
Apr 18, 2005

introductory programming is not about binary trees though, it is about getting people to the point where they understand what programming is and how to break a problem apart and string together a program out of it

and as it turns out python is working rather poorly

Cybernetic Vermin
Apr 18, 2005

those are literally all possible choices yeah

Cybernetic Vermin
Apr 18, 2005

Zombywuf posted:

There is far less to learn when learning assembler (at least with a decent assembly language). The first difficulty with beginners is syntax and vocabulary, asm has near trivial syntax and a pretty limited vocabulary. For the same reason Logo would also make a good intro language.

a core concept of the introductory course should be functions though, local variables, scopes, and all that, and assembler is a bit too permissive there.

Cybernetic Vermin
Apr 18, 2005

we used to do sml as the first language. that worked very nicely, very few moving parts (modules and all imperative stuff cut). ended up getting axed due to student pressure though, it was felt too useless in the real world (an argument i feel is out of place in the first programming course)

i think java was the right idea for a replacement, but we don't do that any longer either

Cybernetic Vermin
Apr 18, 2005

MononcQc posted:

I work in real time ad bidding, and we use Erlang (so does OpenX, they use one of my libs for dispatching client calls). Concurrent GC works 100% fine for us (we generate between 70MB to 100MB of garbage per second per server).

In our case, the GC works so well because each request basically ends up having an independent nothing-shared heap+stack space, and the VM will GC them when they get descheduled for another request, or when the request is done and it can basically throw away the entire heap+stack space for that process.

Also I'd consider us to be soft real time rather than hard real time, but I guess that can be debated.

the software term "realtime" is misapplied a lot, it really should involve precise cyclecounts to ensure that systems always respond before some physical deadline. for trading systems (which I guess your system really is) one often says high-frequency when you want to minimize response times and the expenses get much greater with longer delays (e.g. it gets increasingly probable that one is missing an opportunity)


VanillaKid posted:

Yeah just make people deal with a lot of memory management overhead instead of letting them focus on the computer science part of computer science

the cs students are pretty easy since they pretty much breeze through the intro programming either way, lots and lots of majors have some programming though

Cybernetic Vermin
Apr 18, 2005

Nomnom Cookie posted:

pascal is a good first language imo

yeah, actually a very reasonable language

kind of practically impossible since people will assume you are completely stuck in the past though, sml ran into that issue as well

Cybernetic Vermin
Apr 18, 2005

lets fool him into buying tibco rendevouz licenses :mmmhmm:

Adbot
ADBOT LOVES YOU

Cybernetic Vermin
Apr 18, 2005

Star War Sex Parrot posted:

my gf was required to take 1 programming course for her engineering degree, and it was C

I'm sure learning how to tokenize c strings will be useful some day?

what a loving waste of time

the c course is for engineering majors here as well, but the fact that they are engineering majors is enough of a reason to avoid focusing on strings, the very first three labs they do are:

  • write a program that reads a number (use gets or whatever we don't care now) and determines if it has a prime factor other than 2, 3, or 5.
  • write a menu-driven yatzee-game, you are given a list of functions into which the solution must be broken (e.g. int throwDice(int numberOfDice) etc.)
  • your program is given an input file of the following form ... (gives height, width, four float temperatures and a tolerance), compute the temperature distribution on a rectangular plate in a vacuum where each the north edge is fixed to the first temperature, the east to the second, etc. by computing the temperature spreading across the plate in a height*width grid, run the simulation until the total grid change in one iteration is less than tolerance. Dynamic memory management, using structs, and proper use of functions is now required.
  • (more here but now they are getting annoying to type out)

making the labs even artificially related to their field of study is a really good start in inspiring students a bit. c has worked out better than i expected, though extremely hard to diagnose errors, like memory corruption, is still too big an issue for it to be quite worth it.

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