/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

bitsquid.blogspot.com/2014/10/building-data-oriented-entity-system.html
blog.molecular-matters.com/2013/02/22/adventures-in-data-oriented-design-part-2-hierarchical-data/
en.wikipedia.org/wiki/Deletion_(genetics)
twitter.com/AnonBabble

Lisp is the most powerful programming language.

How would you data-oriented-design a scene hierarchy

with oop

It's too late /dpt/. I'm fed up of your constant arguing. I'm going to use Common Lisp.

Why is C so comfy?

static unsigned strtok_static(const char *str, const char *d)
{
unsigned count = 0;
unsigned char lut[0xFF] = { 0 };
while ((lut[*d & 0xFF] = *d) && *d++);
while (*++str)
if (lut[*str & 0xFF] && !lut[*(str - 1) & 0xFF])
count++;
return count + !lut[*(str - 1) & 0xFF]; /* end token */
}

Replacing current backend with elixir as C# is a pain to do anything with. Will be interesting to see the performance gained over the old buggy server.

Depends on the scene

Flatten your tree so that if you go through the array of nodes you're guaranteed to transform parents before children.

>dynamic types
>performance gain
funny joke

building a realtime currency converter in c# what apis would you recommend?

The only right choice.

A scene with a root, there can be actors that are spheres and cubes and a torus and each of them would have a 4x4 matrix of their transformation. each actor can have a variable amount of child-elements which inherit the transformations of their parent

HashMap

Have you never had a look at erlang?

explain
how would a tree flatten out like that?

if i have nodes, and those nodes have a variable amount of children, and those nodes have a variable amount of children, how does that work.

Catamorphism

Yes.

Children reference their parents, not the other way around. As long as every child is transformed after its parent it doesn't matter how else they are organized.

Then you would know why Elixir is the language of choice in this situation

I'm only interested in hylomorphism-level programmers.

Why, if I've never had a look at it?

if you flatten out into an array how would you know that node b references something 5 nodes ahead

zylomorphoisms are better

Distributed computing, cloud-haskell would be fun if I didn't have issues deploying it. Plus EVM is has been used for years and is easier to throw on the machines we use.

I'm kind of interested in dep types for expressiveness, but I really, really don't like the idea of losing type inference.

Is there any research on Dtype systems where a large subset is known to be decidable? What if you kept DTypes but excluded HKT's?

Indices? Pointers? And it wouldn't be ahead, it would be behind.

Are there really any male programmers?

saying "flatten your tree into an array" has no mention of how something like that is even done or structured ass hat, how would you even iterate something like that to propagate a root-transformation down to its children.

Like save the effort of a back and forth and try actually explaining something maybe.

Yes, though most seem to either be beta or have some kind of issue disqualifying them

SMT refinement types (liquid types) are all there really is on that front. HKTs are not a problem in general, either. The main issue with type inference and dependent types is that unification becomes undecidable very quickly as you add higher order features.

Bidirectional type rules are commonly employed with dependent types to at least limit type annotations to mostly top level definitions which is good practice anyway.

Catamorphism

I don't think I will, now.

>SMT refinement types
Are they as capable/powerful as dependent types? Been seeing hype about them.

but i will
bitsquid.blogspot.com/2014/10/building-data-oriented-entity-system.html
blog.molecular-matters.com/2013/02/22/adventures-in-data-oriented-design-part-2-hierarchical-data/

Not nearly. Refinement types are just making types smaller using predicates, liquid types restrict those predicates to formulae in SAT + decidable theories. Much more convenient, for sure, but you simply cannot express many interesting predicates nor do you have anything like inductive types.

Thanks user.

If you're not using Kotlin by New Year's, you're getting roped.

I'm using Idris. Kotlin is laughable.

cast 1.5 + 5

>Idris
What is the point?

A good compromise between correctness and ease of use

It's going to be like Haskell with around 10 users and nil implementations outside of very niche cases.

More work on my kernel.
Got initramfs working, time to work on userspace and program loading next.

On a side note, I can't tell if Qemu/KVM is buggy or my kernel is buggy, because I've been getting some very strange page faults and KVM emulation errors in certain situations, and it might have something to do with how KVM "zaps" shadow pages, at least that's what's logged in dmesg. All debugging fails.
Anyone else experience similar with Qemu/KVM?

anyone do web automation stuff with selenium?nhere

...

nothing todo with web design m8

wdg isn't just web design m8

>10 users
Try 0 users.

why are you feeding a pointer as the subscrpt for an array?

Try S (S Z) users.

Do you guys recommend Kotlin or Java for android development?

No.

I think you're confused by what DOD means.

Maybe you guys can help. I've been desperately trying to install the windows sdk and this is what it keeps telling me. It seems to think I already have it but I'm 100% sure I don't.

just develop for windows on linux and cross-compile using mingw-w64

>ease of use
If you don't mind the 5 hour long builds, sure.

Better than 5 hours of writing unit tests.

okay I finally get the appeal of emulating OOP through ADTs and Traits.

But the fucking borrow checker and lifetime shit are painful

Kotlin. It's becoming the new standard quick. Plus it's not like you're missing out on Java if you're coding in Kotlin, you can still access 100% of Java code without hassle.

What programming language is most like DNA? It compiles no matter what, even if shit is missing, no matter how fucked up the results are.

DNA doesn't work if shit is missing, that's why miscarriages and cancer happen.

>What programming language is most like DNA? It compiles no matter what, even if shit is missing, no matter how fucked up the results are.

That's not how DNA works.

Genius.com doesn't return song lyrics with API calls for some fucking retarded reason

Is it rude to scrape their search and then use those links to scrape lyrics (tens of thousands of requests)?

I don't know why they would set up an API for a lyrics site and withhold the fucking lyrics.

en.wikipedia.org/wiki/Deletion_(genetics)

>compiles (people are born) despite shit being missing

>for some fucking retarded reason
you really think they're gonna let you scrape their core product so easily?
it's like how news sites have disabled or gimped their RSS feeds to link to the original article so people don't get to skip the ads.

c++ is the greatest language of all time

thats not how you say assembly

To. 63696619
How often do you post things like this, expecting (You)s or a derail?

What does "imperative" even mean in the context of completely abstract languages (e.g. lambda, pi calculus)?
Small-step semantics typically give a language precise rules of evaluation. E.g. given an expression, we can figure out what it will eval to in the next "step". If it's deterministic, then there is only one step it would eval to. This is very much akin to "imperative languages", where the semantics take single steps at a time (e.g. one instruction after another). Yet, functional languages are typically modelled this way.

>>compiles (people are born) despite shit being missing

I assume that's what happened to you.

Wrong, it's java.

Kotlin*

You were close though!

*underused

Not really. People with genetic deletion disease are in poor condition and its hard for them to do a lot of things let alone post on a Zimbabwean Theater Forum.

just installed jdk what should i program? first time using jarva

A compiler for a better language

Install IntelliJ and make Conway's Game of Life in Kotlin.

It's like 30 minutes of work to write a search and lyric scraper.

Now they have to serve full page responses instead of json responses from an API client for usage tracking.

enjoy getting IP banned

What are VPS that cost tenths of pennies a minute

Genius is bloated and trash anyway.

what does the javac do thats bad

Compile Java.

screw you guys, im going home

Back to India, I hope.

every indian i know uses c#

aren't you jewish

(define iterations (make-parameter 1000))
(define basis (make-parameter 1))

(define (sqrt n)
(define b (basis))
(define c (- n (sqr b)))
(for/fold ([x 1.0])
([_ (in-range (iterations))])
(+ b (/ c (+ b x)))))

>It's becoming the new standard quick.
Lies.

can you recommend me a book or something

>kotlin
aka At Least It's Not Java
clojure is a better meme imo

>decode it

how the fuck do you guys have so many threads per day
does anyone here actually program?

Some are on vacation (me) while others just like to argue over pointless things.

Yes I do.
atoi: li $t2, 0 # reset space marker to false
bgt $t0, 0x20, currentIsNotSpace # is ascii code above 0x20, not a whitespace character
jal getNextChar

currentIsNotSpace: beq $t2, 1, storeInt # jump to store integer if whitespace has been reached
addi $t7, $0, 1
mul $t1, $t1, 10 # prepare next digits place
sub $t0, $t0, 0x30 # convert from ascii
addu $t1, $t1, $t0 # store converted number
j atoi

getNextChar: lbu $t0, ($s0) # store current character of array in $t0
addiu $s0, $s0, 1 # increment index to next char
beq $t0, $0, storeInt # has finished parsing when $t0 is null
beq $t0, 0x0A, storeInt # has finished parsing when $t0 is null

bgt $t0, 0x20, ret # go back to atoi when character is not a space
li $t2, 1 # mark that we've hit a space, therefore should store an int
j getNextChar

ret: jr $31


This isn't interesting just wanted to prove I know assembly.

A C compiler would be able to produce much better code than this

>mips
i'm so sorry

Questions for Unity/C# people
IEnumerator someFunction()
{
yield return new WaitForSeconds(5.0f); // line 1
yield return StartCoroutine(otherFunction()); // line 2
}

IEnumerator otherFunction()
{

}


1) Do changes in values between the execution of line 1 and the execution to which line 2 refers not make a difference?
(That seems to be the case with my testing.)

2) If so, what would you recommend doing so that otherFunction() only gets the latest values for the variables *after* the 5 seconds pass?

in my new job I have to use clear case on a remote server to build and track files, no IDE unless I copy files to my local machine over sftp and back. After 6 months I still do not have hardware and a debugger of my own I can use (embedded system) and have to borrow someone elses when I want to test. The code base I work on has no comments or consistent naming convention, put all global variables into a single structure, and in fact is not documented anywhere. There are no requirements written for this module. The full production application itself is actually split into 2 parts that must be built separately and combined (plus some other pieces).

should I kill myself? should I quit? I already quit my last job after only a year because I thought that place was bad, but this is worse, but I'm paid more. Please send help

Post some code that includes what you are actually trying to have show up by the time otherFunction is called that doesn't seem to work.