/dpt/ daily programming thread - Julia edition

/dpt/ Julia edition.

Last thread:

Attached: julia.jpg (2560x1920, 3.45M)

Other urls found in this thread:

juliacomputing.com/case-studies/mit-robotics.html
cs.cmu.edu/~rwh/theses/okasaki.pdf
u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
github.com/JuliaDiffEq/DiffEqBiological.jl
en.wikipedia.org/wiki/Hamming_weight
twitter.com/NSFWRedditImage

>running into long patched internal compiler errors on our frozen ancient embedded compiler
kill me kill me kill me kill me kill me killme

Attached: Unsorted 2728 (SU).jpg (639x719, 53K)

For a GCed dynamic language, Julia works surprisingly well for real-time applications:
juliacomputing.com/case-studies/mit-robotics.html

Mainly because it gives you a lot of tools to avoid heap allocations entirely, and to benchmark heap usage when developing in it.

oh my god, i demand a proper explanation for the oracle vs google android java api lawsuit. what exactly does oracle allege that they copied? method signatures? implementation code? GIB SPECIFIC EXAMPLES

Is it still productive to read an algorithm book even if you don't understand most of it(the "mathy" stuff). I am reading "The Algorithm Design Manual", and I would be lying if I understood all the math in it.

Don't mind me! Just shilling for my thread.
boards.Sup Forums.org/g/thread/65132090

Couldn't even link right :(

yes, why not?

doesn't the break statement invalidate the goto?

>mostly as a cheap hack to escape loops and functions
that sounds useful, what's the downside?

Julia is a great language. As powerful as python but as fast as FORTRAN.

post some julia code you lads are working on.

I hope everyone else in /dpt/ is having a very classy Friday night.

Attached: IMG_4044.jpg (4032x3024, 1.96M)

Any recommendations for good intermediate Haskell projects?

That's a great book; you'll learn a lot even without a superb math background

Awesome, I was seriously thinking about giving up many times, because my math background is kind of lacking lol. However, I am reading this, along with "Algorithm Design" by Tardos.

It just literally embeds the Python interpreter into itself. Any language can do that.

Implement these:
cs.cmu.edu/~rwh/theses/okasaki.pdf

Attached: 41XlPaC+ZqL._SX326_BO1,204,203,200_.jpg (328x499, 27K)

Anyone have the picture with all the different programming books ranked by goat, good, etc.

Attached: 29177663_2011280722468333_530361880472977408_n.jpg (918x960, 75K)

It's considered harmful.
u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html

What's your opinion on gradients in GUI?

I helped rework the code over at github.com/JuliaDiffEq/DiffEqBiological.jl

the reaction network DSL lets me just write down a bunch of reactions with their corresponding rates without even having to bother with manually translating them into differential equations. The macro does it by itself.

>and runs faster than python
why is that?

...

Because it's designed for speed from the beginning, while Python was not (hence the gazillion dicts everywhere which the runtime can't optimize away because some libraries use them).

Properly written Julia is within a factor 1.5x of C code like most memory safe compiled languages, while Python is more than a hundred times slower.

>julia uses sepple style ::
absolutely gross
p.cool though.

The :: operator is not from C++ (where it's used for disambiguating names), it's syntax is borrowed from the Haskell/ML family (where it means that a variable is of a given type).

>where it means that a variable is of a given type
should adopt the "the" keyword from idris then.

>Friday night
It's late saturday afternoon, though.

The Julia parts of programs will obviously be faster since it's not as dynamic. Who cares though? Chances are you will be using Python libraries to do the job for you anyway.

my idea of a fun friday night is reading the cpp core guidelines

>cpp core guidelines
atleast read something useful like an algorithm book

>tfw too dumb to use vim/emacs
>tfw VS code isn't real open source
>tfw only real option left is atom

I was just passing by to shitpost, but this is great thanks

Vim is easy.
Just install the tree-nav plugin
practice opening,closing, and splitting new buffers
and maybe a fuzzy finder

Or just stop being a weenie and install vs code.

I randomly noticed that's by Skiena, who I happened to remember from enjoying some lectures by him on youtube about combinatorics, supplementing a class I was taking.

Went back and holy shit the quality is awful. But there's other videos, and that combinatorics lecture I remember was old, maybe digitized from VHS or something. So I went to those, every single one is terrible. Some have a useless slide up with a tiny camera of him at the whiteboard in a box. The audio's awful.
Stony Brook, get your shit together. Thanks for listening!

How does one calculate complex-valued functions, such as e^(3+4i)? And I'm not asking what library to import, I'm asking how such a library would implement it. I already know about the taylor series for exponential, sin, and cos functions, but they seem like very inefficient ways to calculate them.

Why does your IDE need to be open source. Do you think Microsoft is going to steal the code for your dogsitting app or do you just suffer from paranoid schizophrenia?

but i already read the art of computer programming three times forwards backwards and picking pages at (pseudo)random

>cares about open source
>literally has NSA backdoors baked into her CPU
it's like listening to vegans

>they seem like very inefficient ways to calculate them.
Consider trying it, dropping 5th degree and higher terms, then 4th, and 3rd, and check the loss you're getting compared to the speed increase

>he doesn't exclusively use older AMD processors without the platform security processor

>he

The only python library I ever use from Julia is matplotlib as a backend to plots.jl.

For numeric stuff, Julia libraries are much, much nicer than the numpy ecosystem, and any python library that is a bunch of C bindings will have either better bindings in Julia or a pure native Julia library.

sick of my compiler mansplaining my own code to me like??? ugh

Try Rust. You'll love it.

I guess you could compare it to voting with your wallet. I'd prefer open source to be the standard but that will never happen unless I support open source projects. This doesn't mean things would be perfect, but I think it makes things the tiniest bit better which is better than nothing.

>I lost one of my legs, I guess I should just chop off all my other limbs while I'm at it

Are there any good resources on general C++ efficiency. As in runtime speed. One also bring doing lots of OpenGL lately and lots of people and authors talk about efficiency, but I see not good explanation on how to determine that efficiency. Of course just test your code, but some talk as of certain techniques should just be known. Maybe some general resources on graphics or GPUs?

learn to read assembly and use a profiler
that's pretty much it

the general heuristic for writing efficient C++ is to write C instead

I finally understand moan ads.
It's easy once you understand funk doors

Attached: poo.jpg (540x405, 2K)

i'm sorry for assuming your gender, xir.

Start studying how C++ is implemented. Delve into the compiler and start figuring out the xboxhueg machinery it generates for you every single time you write some shitty class.

Then switch to C.

Reminder that C classes are less efficient than C++ classes.
A C class:
struct MemeyFuckerino {
void (*init)(struct MemeyFuckerino *); // constructor
void (*cleanup)(struct MemeyFuckerino *); // destructor
int aVariable;
int (*getVariable)(struct MemeyFuckerino *);
void (*setVariable)(struct MemeyFuckerino *, int);
};

A C++ class:
// *blocks your path*

in C++ u dnot have tro waste estra space in every single object because the function pointers are not stored in the objects they are stored in a vtable pointed to by the object

The taylor series for the exponential function (includes sin,cos) converges very fast and is actually a reasonably efficient way to compute it.

Of course, you need to be smart to avoid big arguments. Reduce it modulo 2*Pi*i ofc. You can also use a trick for the exponential function where you compute exp(x) as exp(x*2^{-k})^(2^k) to make the Taylor series converge faster (squaring k times). You repeat this until |x| is smaller than 1.

What's the best way to remove hair from legs and ass? Programming socks in the mail.

There's literally nothing stopiing you from just using a vtable in C.
struct MemeyFuckerino_vtable {
void (*init)(struct MemeyFuckerino *); // constructor
void (*cleanup)(struct MemeyFuckerino *); // destructor
int (*getVariable)(struct MemeyFuckerino *);
void (*setVariable)(struct MemeyFuckerino *, int);
};
struct MemeyFuckerino {
struct MemeyFuckerino_vtable const *vtable;
int aVariable;
};

also I'm you, you're responding to yourself right now to preempt anyone else from correcting you

Wow, you sure are stupid.

Thanks, it takes practice.
Also this me:

>C classes

nobody does this retard

>this new

struct wowyoureadumbass
{
int variable;
};

void init(struct wowyoureadumbass *for real);
// etc


now you never have to store function pointers anywhere wow

every1 dus
ya but thitits not OPO

* OOOP

I do want to familiarize myself with assembly, I'm reading a computer architecture textbook right now to get a foundation. From what I understand does more more assembly generally mean less efficient? Or slower? Comparing std::list and std::vector, std::vector has much less assembly calls. I understand they have different usages, but they can arguably be used the same way.

* OOp

Not that you weren't already retarded, but did your IQ just drop by 20 points?

Also, I'm you again. You're preempting anyone else calling you stupid by doing it yourself. As you usually do.

And, by writing this reply to yourself, you're exposing yourself as a troll.
This is something /dpt/ should already have been aware of by now, however, since it's inconceivable that someone could actually be as stupid as you're being.

break only applies to the inner loop

>samefagging so hard that you literally fucking deliberately make sure everyone around you knows you're samefagging

Attached: anintellectual.jpg (381x247, 1K)

What do you mean more assembly? More code? That's probably slower due to taking up space on the processor caches.

why do people use vim and emacs? i'd imagine there's a ton of other text editors that have a gui and do whatever unique shit they do.
>hurr i'm more accustomed to using thirty hotkeys
>durrrrr i'm using a 16 bit computer and can only run my system via cli

Attached: mgs v thirsty boss who needs a drink.png (1486x1118, 509K)

(this was also the troll aka me)

Basically, you're too stupid to understand.

have a (You)

>does more more assembly generally mean less efficient
for very simple primitive operations yes, but x86 is a very complicated architecture and not a lot of code in it will be purely simple operations

the other complication is that memory access takes far longer than any other operation and can miss cache levels and take longer still

the reason lists are generally considered less performant than arrays has a lot more to do with the algorithmic complexity of their operations (e.g. traversing a list is linear, traversing an array is constant) which means the performance of each one heavily depends on how you use it

lists also introduce a lot more indirection, and the elements can be spread out over a much wider area of memory, which can result in more cache misses

I use nano because I prefer to start my computer in text mode.
This is because I can't play vidya or look at porn, making it impossible to distract myself.
I can, however, still listen to music, since my media player has a command line interface.
So basically text mode has everything I need and keeps me away from everything I the-opposite-of-need.

sounds like you're a minimalism hipster, try your hardest i'm all ears

i get that, but what if you accidentally open a script that shows you BOOBIES and i'm talking about really ig ooies

Attached: veruca james fucks the shit out of a clown.png (1998x1224, 1.94M)

(You)

Say comparing list and vector, each with just one element. If you check the assembly generated by either, vector had much less.

Awesome response. I should have thought about algorithmic complexity, makes total sense. I'll have to start finding resources on x86. Appreciate it!

I'm gay so it's all good
Regardless, if a script somehow managed to get boobies on my screen despite my being in text mode, I'd be:
A) impressed that whoever wrote it knows how to write to the framebuffer
B) irritated that a program would write to ANY of my device files (besides null, stdout, and stderr obviously) without making it abundantly clear that it was going to do so

It's probably because linked lists access elements indirectly through pointers while vectors are contiguous in memory so the implementation is simple offsetting and it leads to better cache locality.

Post the disassembly.

First of all, they're free. For example if you're programming in Windows in C++ you have to spend at the very least $100 just to get Visual Studio up to a working standard via plugins. You have access to the same tool for free with vim and I guess emacs too.
Working with the keyboard is faster once you know the hot keys.
This isn't a problem for my rig but for some people with older toasters the good IDEs get really laggy.
They are easier to customize than IDEs.
They are at the very least as good as the best IDEs.

Everything about them is better (other than ease of use). And this is coming from someone who uses Visual Studio, but emacs and vim are just better. I just don't want to invest the time needed to learn them.

no no, ascii boobies
>(.y.)

if you're editing text to later compile it, it makes infinitely more sense to use a text editor with a gui. if you're complaining about "free as in beer" software for development there's a multitude of free options. if you're complaining about "free as in freedom" you're a fag who cares about laws.

Attached: pepe inflation.jpg (673x486, 167K)

l--lood >//m//

Attached: 1513927275478.gif (480x270, 939K)

dumb frogposter

>get audited
>get angry lawyers at your doorstep because you didn't pay for your tools
yeah you can't pirate shit when you're earning money

And i have no idea what you're talking about in the first part of your post about a gui making sense for text editing. Once you get used to it, which I don't feel like I have the time for, vim/emacs are just as fast or faster than anything else. Somebody proficient with vim will always program faster than me, it's how it is.

>Everything about them is better (other than ease of use).
ease of use is the whole point of an IDE

>he thinks the only free IDE option is to pirate visual studio

>hide your tools on a home computer you use as a private server
>have both input and output filtered through custom frontends so the tools can't be identified by their specific behavior
>remote into the server from work to use the tools
>never send any commands that would expose the real tools behind the frontend, e.g. listing the contents of sensitive relevant directories
>keep the real tools installed on a usb you have plugged into the server at all times
>about to be audited
>unplug the usb the day before and hide it in your sock drawer

Attached: cpmmunism.jpg (600x600, 50K)

Yeah pretty much. I would say effectivity rather than ease of use. Anyone can be more or less effective without any experience using IDEs while the same can’t be said for vim.
But you can be more effective with vim than you are with any IDE. It’s a matter of personal skill.


In the real world it’s either vim, emacs or vs. At least in Windows. Name one other program for C++, Java ir c# that is nearly as good

dumb frogposter

there are literally hundreds of plain text editors out there which utilize a gui and don't need 40 hotkeys to move a cursor 0.00003874 characters.

also pick your poison with foss compilers your mom fucking gay . faggot

Attached: despacito.jpg (570x570, 51K)

eclipse you fucking retard
>hurr eclipse is bloated/shit/etc
t. clueless tard who hasn't used neon or oxygen

>Name one other program for C++, Java ir c# that is nearly as good
nano
>inb4 "but u can't do IDE stuff with it, only text editing stuff"
nano in a tmux session with shells running in other panes

>also pick your poison with foss compilers your mom fucking gay . faggot
see: >Not that you weren't already retarded, but did your IQ just drop by 20 points?

Right. Which takes just about as much skill as vim or emacs

> traversing an array is constant

I think you mean random access.

Traversal means accessing every element of a data structure.

>write and save file in notepad equivalent
>compile over cli
wow so ez and dang all these women are wanting my penis now

>literally fucking forty hotkeys to do anything
>oh geeze i gotta move up one line oh fuck oh shit where's my fucking chart for all these hotkeys
damn i literally aged into an old man before figuring out how to fucking write the includes for my program

reeee how the fuck does popcount work reeeee reeeeeeeee reeeeeeeeeeeeeeee reeee reeeeeeeeeee reeee reeeeeeeeeeeeeeeeeee reeeeeeeeeeeeeeeeeeeeeeeeeeee reeeeeeee

Attached: ziggy.gif (606x304, 969K)

en.wikipedia.org/wiki/Hamming_weight

Why do you think I care about this?
Is it because you think I'm this guy? Because I'm not, I'm this guy:

>Hamming_weight
fuck you why would i want to gain weight from ham reeeeeeweeeeeeeeeeeeeeeeeee

Attached: images (3).jpg (225x225, 3K)