/dpt/ - Daily Programming Thread

What are you snoozing on, Sup Forums?

Old thread:

Other urls found in this thread:

man7.org/linux/man-pages/man2/syscall.2.html
openlibrary.org/api/books?bibkeys=' books[i].id '&callback=bookInfo&jscmd=data'
codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square
twitter.com/SFWRedditGifs

First for OCaml

reimplementing rust in haskell

Ps3 emulator

i worked on my language

i still need to make some sort of a generic syscall before i can really implement IO and a memory allocator - if anybody has a quick tutorial on how the syscall thing is done in the easiest way possible, so i don't have to search, feel free to post, but it's ok even if you didn't

i'lll find it

have a qt afro american pornstar to motivate your coding

Could have resolved the problem more gracefully if I had another week.
Got all the way from lexing to generating LLVM in a few weeks for a dynamically typed language that hadn't even been fully designed yet.

implementing haskell in javascript

@#59610894
>3d
awful

Rewriting GHC in rust

impossible

On what platform are you handling syscalls in your language?

>he used LLVM
>he didn't compile str8 to assembly
brainlet you will never make it

PHP+MySQL name voting thing is working. Now the main problem is that there are 6466 names to vote on, and that's just way too many for me+a couple skype friends to handle. I guess I should look into cheap hosting and put it up online.

module deduplicate_string_array;

//re creating the array without duplicate values
//updates the array, returns void
void deduplicate_string_array(ref string[] elements)
{
for (int i = 0; i < elements.length; i++)
{
for (int j = i+1; j

i need a source

i assume this is directed at me
i use linux and have been thinking about an easy way of making a generic syscall

the issue is that in linux syscalls use registers and not just put function parameters on the stack when you do a 0x80 interrupt, so it almost feels like i need to sit down and write assembly, but i haven't done much research yet
the language doesn't touch the heap yet, because no brk

either way even if i left the lang alone, i'd be able to work on it in the future it has some degree of completeness, just doesn't touch the heap lol

It's Brittney White.

what happens if two people upboat at the same time?

god bless you

First time I see you saying something useful. Well done. You're progressing.

fucking kek

>generating 1:1 target dependent code
You have to know register coloring which we never didn't have time to cover

That's a good question. I haven't considered race conditions. My MySQL skills are very basic.

You're welcome.

t. Negress man

Do compiler optimize the target code or the user code? Or an intermediate?

>the issue is that in linux syscalls use registers
Windows sys calls use registers aswell.
I don't know how to make a language but what if you specified the syscalls for each os and architecture?

shit, that's actually something that requires learning
i just did a 'I'm all over the stack approach and push and pop a lot'

It optimized an intermediate representation

>what if you specified the syscalls for each os and architecture?
oh no, this is only for linux

it's supposed to be easy and for learning purposes

well, what's your schema?

probably stay inside of posix standards, but that's not always perfect either

Is division still considered as a slow-downer in the code or it's not important nowadays?

If you don't need a float, just do repeated subtraction instead.

Sure, but there are usually more pressing issues to worry about, such as memory access.

You probably don't get to learn that unless you focus on languages in a phd program. For everyone else, intermediate languages are the way

>i assume this is directed at me
Yes, I forgot to add a quote/backlink.

>i use linux and have been thinking about an easy way of making a generic syscall
Are you aware that on Linux, syscall() is also a function?
man7.org/linux/man-pages/man2/syscall.2.html

>the language doesn't touch the heap yet, because no brk
Just link against libc. You'll get brk() for free.

C is a fine intermediate language
Is there really any reason to use LLVM instead?

The purpose of intemediate language is to be easily parseable. Such language is usually bytecode.
C is not a fine intermediate language.

these sluts are starting to grow on me a little
i like to stare at them especially irl, i like to stare like a creep
though black girls around here are different than in america
well i made use of a simple intermediate language that looks like python lists, since i wrote the compile in python

anyway i think i'll move to a differnet project and worry about heap and syscalls and memory at a later point
yes i'm now aware and i did some quick reading and you can actually implement a generic syscall, but i am not very clever and will need to try it out first, how it works in C exactly, maybe look at the assembly and get ideas
i don't want to link against libc, for no logical reason
>compiling to c
doesn't that make things too easy? but it probably works VERY well in practice
#["while", ["

How much time is spent debugging and fixing errors?

Depends on almost everything

for (var i = 1; i

>these sluts are starting to grow on me a little

They are perfect in every way.

>i like to stare at them especially irl, i like to stare like a creep

Me too, but I'm sure they can tell I'm autistic.

>i + ""
>Integer + string
How to dynamic shitters defend this?

>Windows sys calls
Windows syscalls should ONLY be done as calls into kernel32.dll functions, as the syscall number for any given syscall on Windows can be subject to change between different versions of Windows, or even between different service packs. There is zero guarantee of any consistency in the ordering of the syscall numbers.

1. Less time spent parsing C. It's silly to compile into one intermediate format that will only need to AGAIN be needed to be compiled into an intermediate format.

2. Ability to use intrinsics that might map to certain instructions that C compilers won't necessarily emit.

>how it works in C exactly, maybe look at the assembly and get ideas
A C compiler is not going to emit the syscall instruction at all, unless it is built on a platform where it is forced to. Functions like write(), read(), brk(), and such are all going to be in the libc library on POSIX systems. Those functions are then going to call a function called syscall(), which will ACTUALLY invoke the syscall instruction, and the kernel does the rest.

in practice C code runs very close the machine and is very portable.
While LLVM might be proper, it would still work pretty well.
Also C doesn't even have a proper parser in the traditional sense since it was designed before most of that.
Is this your AST?
Why do you need an intermediate language for it?

>1. Less time spent parsing C. It's silly to compile into one intermediate format that will only need to AGAIN be needed to be compiled into an intermediate format.
>2. Ability to use intrinsics that might map to certain instructions that C compilers won't necessarily emit.
fair enough

>A C compiler is not going to emit the syscall instruction at all, unless it is built on a platform where it is forced to. Functions like write(), read(), brk(), and such are all going to be in the libc library on POSIX systems. Those functions are then going to call a function called syscall(), which will ACTUALLY invoke the syscall instruction, and the kernel does the rest.
oh i see then i will think about linking against libc and then just writing an allocator after i have brk, though i will have to read for that too because i don't exactly remember how that worked - the details
the real language looks almost exactly like the 'intermediate', but it's more convenient to write in
i posted in last thread
@(function fizz_buzz () ((str fizzbuzz "fizzbuzz\n") (str fizz "fizz\n") (str buzz "buzz\n") i)
(while (< i 100)
(begin
(if (and (== (% i 5) 0) (== (% i 3) 0))
(print fizzbuzz 16)
(if (== (% i 5) 0)
(print buzz 8)
(if (== (% i 3) 0)
(print fizz 8)
(print_num i))))
(= i (+ i 1)))))

They don't need to, because they're busy getting things done instead of bickering over types.

Windows syscalls should ONLY be done as calls into kernel32.dll functions, as the syscall number for any given syscall on Windows can be subject to change between different versions of Windows, or even between different service packs. There is zero guarantee of any consistency in the ordering of the syscall numbers.
Thanks from now on this will improve my advancements on learning asm.

it is okay friend. it is your duty as a white male to lay and impregnate them. teach them to respect and appreciate your superior white 卐 python 卐 dick. just don't marry and don't raise bastards from them.

What do i need to crack an android app?

Lucky Patcher?

Brains

opening for an embedded controller programmer nearby. I think its for like forklifts and shit

what am I in for bros? I'm guessing C?

for (var n = 1; n

>superior white 卐 python 卐 dick
i lol'd must admit, my racially conscious user
i've more of a chode desu and i can't make that programming related
anyway i'm off to sleep

>I'm guessing C?
probably something earlier

yeah hopefully the fuck not because I'm not going back in time any further than C

There's an API for finding information on books that I use by creating an HTML script tag which includes the ISBN in a certain way, which then sends an object to a Javascript function as an argument if the book is known.

The problem is though that I need to somehow have the ISBN passed to the function as a second argument, because if the book is not known, the function needs to know which book it was run for so it can do what it does if book information is missing.

The script tag src looks like this: 'openlibrary.org/api/books?bibkeys=' books[i].id '&callback=bookInfo&jscmd=data'
Is there a way I can modify this src so that it sends a second argument to the function "bookInfo"? The argument must be books[i].id

something like this probably

So I took the windows-pill a few months ago, and I can see the appeal.

I've been messing around with the Win32 api, which is total shit but I learned it faster than any other api so far. The reason for this is because of just how well it is documented. Linux NEETs need to learn how to document better before complaining about their small market share

what they really need is preinstalls

>Linux NEETs need to learn how to document better
What? The POSIX C API has excellent documentation.

Will you post the source?

...

>C is a fine intermediate language
C is a fine beginner language

Haskell is a good beginner language
Idris is a good intermediate language
ATS is a good advanced language

Sounds like a very angry manlet. Is that your blog?

And they're all trash to boot!

source?

intermediate from user to target language

Making a dumb little gui that has a picture on it with window forms.
It won't resize when the window does

Haskell is a good beginner language
Haskell is a good intermediate language
Haskell is a good advanced language

What we learned here is that Haskell is the best language for anyone, period.

t. OOP programmer

t. brainlet

t. hated his Haskell classes

Haskell typeclasses are indeed worthy of hate.

You seem to be an incoherent sort of person.

>only ebook lunk is a usenet one
fuck i really need to join a private tracker.

I'm about as coherent as Haskell's syntax.

Do you guys hate github? I don't like that I need to download their thing to upload some code onto their site

Sup /dpt/
>starting from the bottom beginner here
where should i start to be the wizard?
I don't have any previous knowledge of what programming it's, but i have a concept
so guises feel free of helping me out

github is not related to git

what is git

How is the first supposed to be a bad thing? Most closed-source software that isn't by a big name company ends up like that. At least it being open source means YOU can look into the bugs and fix them yourself, which simply isn't an option with closed-source.

Windows is documented shitty as fuck, it's just easy. Coding some angular site with a .net core backend for a customer and this windows shit is boring as hell

i've been falling for opensource meme for quite some time. then i looked at world practices and was like fuck it, fuck open source. the users can only be free under my control. this is how its gonna be. everyone is building their botnet, i am building mine. normies deserve to get fucked.

>.net

that's too bad

resources on program correctness?

git gud

thoughts on recursion?

long rec ( int n, int r )
{
if (n < r) return 0;
else if (r == 0) return 1;
else return rec(n-1,r-1) + rec(n-1,r);
}

my timer keeps doing these spikes and I don't know why.

See

>Sup Forums is still comparing their fizzbuzz e-penis
why

Inefficient as fuck

error in nanoseconds btw. i is incremented every 10ms.

better use a loop

I made this:
codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square

I was inspired by this:
Please help to improve

1) floating point?
2) overflow?
3) you're an idiot?
One of these

1) std::uint64_t
2) see 1
3) possibly