/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1516914173592.jpg (500x667, 72K)

Other urls found in this thread:

autosar.org/fileadmin/user_upload/standards/adaptive/17-03/AUTOSAR_RS_CPP14Guidelines.pdf
youtube.com/watch?v=bebuiaSKtU4
youtube.com/watch?v=jASoGkYrtRk
twitter.com/NSFWRedditGif

nth for Nim!

friendly reminder programming is a subset of Anime.

i wish i could draw like that

but anime is the superset? this is a tautology user!

What language do underage anime girls use to code?

hasklel

Attached: 1550184344856.png (1000x793, 638K)

Nim!

that's a very elegant yuno

Attached: dpt.png (553x493, 50K)

I want to send an image over tcp in elixir, but I'm kind of stuck because I'm awful at this stuff.

To start with File.read just returns {:ok, ""} and then I'm not sure what to do with it when I get it. Can I just do :gen_tcp.send(client_socket, file)?

yuno it

Attached: 1548826582936.jpg (1280x720, 231K)

If she hates pedophiles why does she have a photo of Stallman?

I thought I wanted to do c++ development but working with other peoples code actually stinks. I unironically would rather do java.

Got into a bit of a hole and haven't written a single line of code in two weeks. Feels pretty awful as I've had a really productive year otherwise. LIstening to the Maniac soundtrack trying to get myself into the groove again.
Any Jow Forumsentlemen have suggestions for getting into the mood to write programs?

just follow the autosar standard, it's pretty reasonable:
autosar.org/fileadmin/user_upload/standards/adaptive/17-03/AUTOSAR_RS_CPP14Guidelines.pdf

My current two soundtracks depending on mood:

Chill mood:
youtube.com/watch?v=bebuiaSKtU4

Non-chill mood:
youtube.com/watch?v=jASoGkYrtRk

Also for me, comfy lighting is very important. I am currently programming in the dark next to a fireplace. It's pretty good :)

Do you know what you want to work on, user?

Money. It's money. Holy fuck why would I do programs unpaid? Also I only do programs between certain hours on certain days at a specific location.

It's not hard enough to describe programming as "sucking". But it's more like posting "guys how do I get in the mood to recreationally stock shelves?"

I'll try switching some lights around I think it's a bit too bright at the moment.
Yes I already have a project I'm working on and have a good idea of where I need to go with it but everytime I sit down I end up browsing 4channel.

FWIW sometimes when I don't feel like working on "the direction I want to go with my project" but I still want to do some programming, I like to do a bit of refactoring and cleanup.

>Any Jow Forumsentlemen have suggestions for getting into the mood to write programs?
amphetamine

java, no exceptions

just leads me to shitposting sprees across multiple boards

Really? I'm quite the shitposter myself, though I've never tried amphetamine. I wonder how it would enhance my shitposting. I suppose the results could be quite spectacular.

It will probably ruin your life in ways you can't imagine.

SHOULD
I
LEARN
PONY
LANG

If dubs: Yes

I just take the low doses I'm prescribed, I wouldn't recommend it if you don't have some form of adhd

No

Working on my OS. Just adding setuid() and setgid() syscalls, along with a simple /bin/su

Attached: Screenshot at 2019-02-21 23-47-38.png (1920x1080, 941K)

Drink some coffee, set up an IDE with Autocomplete, and turn on some Touhou remix music. Works for me every time.

>Haskell
>no concurrency
>no jobs
>no life
oof

>pony lang
Explain to a fellow newfag?

What are some rules for something to count as a Lisp? If I make make everything immutable is it still a Lisp? What about implementation, do I have to use linked lists and a garbage collector for it to count as a Lisp?

Attached: 18fad8ac186db6488890a7e6dedcdd12e039756ae9a8b225240cdaf98d44a3d1.jpg (612x716, 313K)

Can someone explain the >> >>= and operators in haskell to me like im 5?

are you going for POSIX?

They're all functors in the category of endomorphins, you dumb redditor.

music is a distraction and 99% of people are not good at multitasking. any study that says instrumental music is good is bs.

Yeah, what he said.

Attached: 1260585284155.png (523x472, 41K)

Yeah, more or less. :)
And I'd like to shitpost from in there eventually so I am gonna need a lot of compat work.

the base of your programming language shall be the following primitives: ATOM, CONS, CAR, CDR, and EQ

Idk maybe read the manual?

Different ways of joining functions together.

5 year olds can't comprehend Haskell constructs, but I'll try anyway.
You want juice? We have orange and apple.

is from functor
*>, are from applicative
>>= is from monad

>do I have to use linked lists and a garbage collector for it to count as a Lisp?
Yes, both are required
You need linked lists so you can have arbitrary sharing between AST subtrees
And you need garbage collection so closure captures can have unlimited extent

>No concurrency
Never read a bigger lie in my life

What are the theoretical requirements for the most efficient programming language possible?
>lots of inlining
>lists stored as data buffer, not linked lists
>every loop unrolled
>memoization

How can I master regex

Does it implement the Lisp primitives?

>> >>=
Depends on the monad but you can basically think of them as sequencers. Perform the left action then perform the right action.

I didn't build it yet but it will.

u wot m8

is from Alternative

I just realized forcing variables to function as registers would REALLY increase performance and make the compiler's job easy as fuck.
function foo(a, b, c) #all constants
var i, j, k #variables
i = a
i += b
i += c

becomes
foo:
mov rax, [rsp + 0]
add rax, [rsp + 8]
add rax, [rsp + 16]
ret

why do you think those operators were in C

>Passing arguments on the stack when you have dozens of registers available for that
No.

Currently I'm working on a 'batteries included' algorithmic trading app? I guess the idea is like QuantConnect / Quantopian except you self host it.

You'll get a pretty interface and a load of API's you can use to extend it. Supporting both backtesting and live trading eventually.

Also learning about how to 'properly' test things as generally I've been in a position to pie testing off to interns or fucktards on the team but now I'm a contractor apparently I'm expected to know how to test shit. Wtf.

based

friendly reminder that you can't spell anime without nim

>What are the theoretical requirements for the most efficient programming language possible?
only using the things you listed when they're actually helpful. Often times, a small executable is preferable over a slightly faster but significantly larger binary- users hate waiting half an hour for your program to install, but they won't notice if things respond 1-2 milliseconds slower.
Not every loop can be unrolled- if iteration count depends on something unknown at compile time, then it usually can't be unrolled. Storing a linked list as a flat array can have performance ramifications if the list is being appended to a lot. A linked list can perform relatively well if there's a fuckload of random insertions and deletions, so proper performance profiling and an understanding of your application will be more helpful than a compiler that tries to be smart.

Attached: images-10.jpg (300x168, 8K)

haven't worked on this much in the past week, but i did rewrite the map data structures to more closely match what doom uses, so i can use their map editors.
then i'll be able to put together test maps with much less effort than it currently takes (the extreme tedium that is writing bsp maps by hand is the only reason I haven't tried a large map yet)

not much of a screenshot today, but I realized I hadn't tested non-axis-aligned bsp splitting planes until now. this simple test seems to work, at least for rendering order.

Attached: non-axis-aligned-split.png (553x355, 12K)

They're in the highest level of cache, if you're using a cisc machine why not?

ever heard of the instruction cache?

Because registers are completely "free" to access. It's much more efficient to use them as much as you can. Even modern calling convention makes use of them for most of their arguments, and only use the stack when the argument list gets too long.

>Even
Every*

Is that the genesis bsp renderer project?

>thumbnail.jpg
as expected of a nim "programmer"

If we force declaration of vars in the beginning of the function then we could assign registers to those and put the function args in the remaining registers until it runs out of registers and overflows onto the stack. Doing it this way would still keep the compiler rather simple too.
A little, what are some clever ways to exploit that for performance?

None of those things imply efficiency in general. 3/4 of them are just trading away space for time, and arrays vs. linked lists is not that cut and dry. In order for a language to be used to create many and varied efficient programs, it must give the programmer a lot of choice and control, not say "this is how it should be", except maybe if it were highly domain specific.

If your goal isn't solely speed and you want small executable and memory footprint too, the language would just be a customized child of Fortran and C, with many of the quirks that give optimizing compilers trouble removed.

learning Scala atm. I know hardly anything about functional programming and I use Java at work so it should be easier than learning Haskell or Scheme

>If we force declaration of vars in the beginning of the function then we could assign registers to those and put the function args in the remaining registers until it runs out of registers and overflows onto the stack. Doing it this way would still keep the compiler rather simple too.
Congratulations, you're thinking just like C programmers in the eighties. Register allocation is a solved problem, FYI (so is processing things in a different order than they're specified in a text file). The only way it will get significantly better (i.e. aside from heuristic tuning) is if we prove that P = NP.

Took me a good 4 hours to write a Markov simulation of A-B copolymerisation that obeys the Carothers equation. (pic related, its the simulated curve lying directly on top of the calculated curve).
Now to generalise it for triblock polymers and take reaction rates into account between A-->B vs A-->C.
Couldn't really work out a good way to avoid nested if elif loops.

Attached: AB Polymerisation Simulation.png (640x480, 18K)

What makes it so good, user?

>Drawing in a programming thread
Stop patronizing me OP

You know there's PyCall, right? No reason to not use Julia insetead of Python for your usecase.

I think 80s technology is too often dismissed as old and useless. Their compilers were much simpler than ours. They were like TinyC but produced fast executables too. If someone were to replicate that but sacrifice ram for speed which we can afford now, we could produce compilers that are one C file in size and still produce fast code.

I just go to /c/ to look for cute Yunos, and that was a particularly cute Yuno.

Attached: 1543220845606.gif (1050x850, 1.97M)

yes

It helps with motivation. You have to agree that doing something with 80% (and that's quite pessimisitic for instrumental music) is still better than staring at your smartphone in the library and doing nothing like a normalfag instead.

Maybe if you're also going by eighties' notions of fast.

Looks like you're making progress user :) Will be interesting to see how it turns out

>endomorphins
Nice try, redditor.

I'm fully aware of what that word actually meant when I wrote that.

Congratulations, reddit.

Qtcreator is seriously the best IDE I've ever used. It's on par with Intellij but better because it's so fast and doesn't have hiccups. Plus, it has the best Vim mode out of all the IDEs I tried.

Is there any editor that implements structural regular expressions with a non-modal interface? That would be kind of nice.

QtCreator really is amazing. I feel like it has increased my productivity 100%

But it's so ugly.

What the fuck does that have to do with reddit?
I don't use reddit, by the way.

>endomorphins
Category theory makes me happy too, but I don't think endomorphins exist.

doing basic powershell. is this possible? i cant seem to find anything about it

$app1 = "C:\Program Files (x86)\Notepad++\notepad++.exe"
$app2 = "C:\Program Files\Microsoft System Center 2012 R2\Service Manager\Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe"
$app3 = "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.exe"
$app4 = "C:\Program Files (x86)\Microsoft Office\Office16\OUTLOOK.EXE"
$args = "-WindowStyle Hidden -Wait"

Start-Process -FilePath $App1 $App2 $App3 $App4 $args

it doesnt work, how would i get this working?

>Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe
>Microsoft.ConfigurationManagement.exe
>OUTLOOK.EXE
Just imagine, someone at some point actually thought shit like this was a good idea.

me or microsoft? no bully. im new.

Microsoft.

ok cool. yes their shit is way too long

They're still compensating for all those years they were stuck with 8.3 filenames

it's much easier and simpler using a batch script instead of powershell.

Why couldn’t J just be normal and use “/“ for division? Why did it have to be a fag?

>J
>normal
wwww

J is the best lang there is. I wish I could be professional dev

Cause
%
Is visually similar to APL's
÷