/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1551261014568.png (720x720, 423K)

Other urls found in this thread:

jetbrains.com/lp/devecosystem-2019/
github.com/dotnet/roslyn
twitter.com/SFWRedditImages

Bweeh... you can only touch my ears after you finish your JavaScript practices...

Attached: 4b674b7a935338dc24cda36ed5b6fed4.jpg (948x1200, 121K)

my flight got delayed some now I get to program for an extra day :>

jetbrains.com/lp/devecosystem-2019/
learn go

but its too fluffy >.

I feel like writing a lisp interpreter in C

Should I learn Lisp if I hate Jews?

>learn language entirely controlled by this one company
lmao

>tfw using std::unordered_map with no typedef at work

Attached: 1492091896922.jpg (499x499, 49K)

Attached: 2019-08-24-193803_5760x1440_scrot.png (1046x1192, 353K)

I wanna learn something new and interesting but I got no idea what
Do I just read random books from the Jow Forums or /sci/ sticky

Lisp is the most powerful programming language.

>*is completely fucking useless*

Attached: scheme.png (563x161, 84K)

nice bird

Wrong.

Wrong.

I like C!

why is c# so /comfy/

*birb

nandatto

Like I need your consent, bitch
Prepare to get your ears ruffled

>proprietary language
>comfy

Computation isn't synonymous with utility in the same way geometry isn't synonymous with the calculations performed in the construction of a bridge.

Attached: Jerry_Sussman.jpg (206x300, 14K)

Is there any standard-compliant way to tag pointers with extra bits in C?

maybe

Sure, why shouldn't you?

A pointer will generally be the word size of the machine so it's a bad idea to adulterate it, instead you could put the pointer and tag in a struct and treat them as being contiguous.

Attached: 1565980007001.jpg (750x888, 115K)

I'm learning sql

Attached: 1498703624865.png (487x560, 225K)

Obviously I could put it in a struct, I specifically want to avoid that. I know my pointers are aligned enough to have some spare bits.

Then why do fags always tout it as the best language in the world and think everything should use it?

In that case I'd just use regular bitmasking.

I was wondering if someone could tell me why mit-scheme is pushing my chinkpad to the limits

if all the pointers are aligned the same then I think you should be able to use the extra bits just fine
aligned_alloc is C11

There shouldn't be anywhere near 1% CPU usage sitting at an empty prompt let alone 100%. Have you tried compiling it yourself after perusing the config options?

Is the obvious approach of uintptr_t x = (uintptr_t) &obj;
x |= 1;
*(Obj*) (x & ~1);guaranteed to work by at least some authority, ISO/POSIX/gcc/whoever?

Uberbrainlet here. How would I go about doing that?

If uintptr ignores the endianness of the machine I don't see why not.

Attached: 1566411753161.jpg (1280x720, 338K)

If for example you align something on 16 byte boundary (1

>If for example you align something on 16 byte boundary (1

It's about storing other extra information in those redundant bits which can be useful if you have pretty high performance requirements and every bit counts.

Why not just say (offset + (sizeof your_struct)) to access them instead? It may well evaluate into a constant which would be faster than bitbashing.

To add to what said, malloc implementations like in glibc give alignment guarantees. glibc is 8-byte on 32-bit systems and 16 on 64. You get those bits for free, although that's not standards compliant.

self-replicating code?

Yeah but if a struct is memory aligned by x setting the first bit of a pointer to it to 1 would simply access the first byte of that struct.

If there's an array of structs that are all aligned on x byte boundaries with space between wouldn't that result in tons of cache misses?

Attached: 1566133473783.png (1280x720, 526K)

It's used in interpreters for small integers that fit in sizeof pointer - tag bits. Instead of having an allocated object with its own tag, it checks the tag & and if it's a number just shifts out the tag and there's your number.

I'm not sure I understand your question so I think we might be getting confused. Let me quickly restate everything.
user is working with pointers and generally you don't actually need all of the bits of a pointer to uniquely determine the address in the program. So user is trying to store extra information inside of those unneeded bits in his pointers. Other anons are suggesting which bits he can get away with fiddling (the dirty bits molester).
Hopefully I'm both following what's been said and that makes sense.

Has anyone of you ever written any non-trivial program with Forth?

Has anyone of you ever written any non-trivial program?

Attached: 1561634232419.png (300x300, 41K)

No

nope

Yes, and use it against them.

Yes
You'll learn to love Jewish things

I remember trying to write Asteroids in Haskell.
It would crash every time I destroyed a small asteroid.

based, destroying asteroids is a side effect
better to crash the program

shouldn't have let it compile

Attached: 1545392055901.png (671x603, 168K)

I tried out Nu "tranny" Shell.
It's quite fast, and on Windows, even faster than CMD.
But it suffers from a critical lack of coreutils which are necessary for practical usage.

nah that's passivity. you've gotta be proactive and go out of your way. why attack the program when you can attack its users?

>tfw compilation is a side effect
Haskell nev

Nu seems super neat, just waiting for it to get some more features. Bash is garbage and in need of replacement.

Staged compilation using (co)monads could have prevented this

what are your goals?

Does a program used by 500+ employees count as non-trivial?

C# is open source now.
github.com/dotnet/roslyn

Yes, many. But I am not representative of the majority of /dpt/. These threads are filled with larpers with very weird opinions, who don't actually program.

It is, because it's really just a collection of various incompatible implementations, each of which badly implement parts of Common Lisp which are standardized, and thus guaranteed to be portable (see CLOS for an example).
That's why all the criticism against Common Lisp based on the assumption of "bloat" is silly.
The standard officially includes less than 1000 symbols in total, most of which are just functions, thus easy to understand. And you need not remember half of them in order to be productive.
Not to mention things such as double namespace or different scoping rules.
They are good features in practice, amd there isn't a single argument against them which isn't just an emotional appeal such as "it's ugly" or "it's not elegant".
You'll find that this "uglyness" is actually practical and useful for building actual software. When I see "funcall", I immediately know there is some function there being called which will only be determined at runtime. I can't say the same with Scheme, because I have to mentally parse whether the symbol in question is a named function or some variable defined somewhere.
In their pursuit for "elegance", and obsession with being "functional", they forsake practicality.
Lisp (since its original design by McCarthy and its original implementation by Russel) has never been a "functional" language, nor should it be regarded as one. In fact, due to its additional unique ability to violate referential transparency via macros, Common Lisp is arguably one of the least functional languages ever created. Hell, even Elisp is truer to the spirit of the original Lisp than Scheme is. It also greatly influenced Common Lisp. Whether you like it or not, Lisp thrives when you allow mutability.
If you want a language that is truly (almost) functional, go for Haskell or ML, but you want Lisp, Common Lisp is the One True Lisp existing today.
Scheme is an attempt to turn Lisp into something that isn't Lisp.

Can you like Jewish things, but not Jewish people?

>You'll find that this "uglyness" is actually practical and useful for building actual software. When I see "funcall", I immediately know there is some function there being called which will only be determined at runtime. I can't say the same with Scheme, because I have to mentally parse whether the symbol in question is a named function or some variable defined somewhere.
are c++ommon lisplets really this fucking retarded

If you hate them for their ethnicity, no.
If you hate them for shit like judaism or its sequels (christianity and islam), Israeli nationalism, banking, jewish exceptionalism, etc., but are fine with atheist jews and recognize jewish contributions, then yes.

Scheme is a better imperative language than Common Lisp because it has call/cc, the ultimate goto.

Yes.

Redpilled.

but muh unwind-protect

Trying to grow my software company. Changed from being a sole trader to a limited. Also looking for freelancers to hire.

what kind of work do you specialize in

I can work remotely as an idea guy. pm me

Several projects related to poker, mostly C++. I have a program that I am selling online and also some freelance work for poker players.

I want to try new things though, but I feel like I can't do it alone, I already spend all my time programming and I don't think I can increase my productivity that much anymore.

I don't have any in mind... idk what I want to do
Just got a general CS degree idk what specifically I want to work with
Any futureproof professions youd recommend? get into ai?

There are only two things in LISP.
atoms and lists.
WOW!!!

Attached: 27bc.jpg (400x400, 30K)

AI + neuroscience. We are making mind immortal soon.

Except for () which is both an atom and a list.

>Any futureproof professions youd recommend? get into ai?
There was an AI boom in the 80s/90s and this is just the next iteration.

Attached: 1566479349717.jpg (785x562, 76K)

AI is a meme currently, there are uses yes but if you're trying to get a job there isn't going to be that much out there. Learn AWS.

Attached: drank.jpg (800x800, 50K)

If it is both an atom and a list then it is included in atoms and lists.
Fucking Jow Forums can't into set theory.

Many people studying AI end up doing data analysis which is just writing parsers and creating graphs and charts. There are only few good AI jobs.

A list is an atom though.

It's fun, so it definitely isn't useless.

Why are floats called reals in SML if they're actually just rational numbers?

>the language has the only primitives that it has
Isn't this a redundant statement? You can't add new primitives to a language.

Set Atom : {(),1,2,3,4}
Set List: {(+ 5 6),(),(* (- 4 3) (+ 2 3)}

We want mathematician audience

That list isn't a set.

Redundant is probably the wrong word but superfluous yeah.

I see /dpt/ is tiring of functional programming. The rise of assemblyposting is inevitable.

Attached: asm.png (315x320, 52K)

>I see /dpt/ is tiring of functional programming.
never

I need a little bit of help deciding how I can go about this intelligently.
I have a JSON file (one JSON-object per line) like the one in the picture. I want to make a script that allows someone to specify a set of variables, and subsequently have the script output a CSV with those variables. I want CSVs because something like Matlab or Excel can easily plot them without too much of an issue.

The obvious solution is to make a *shitton* of lambda functions and simply match the user variable to a particular "return " function. I feel like there might be a better way of doing this, though.
Any thoughts?

Attached: Screen Shot 2019-08-24 at 12.31.27 PM.png (1868x1760, 828K)

I think you can do that with the jq tool.

Why not?
It is a set of lists. The grammar for lisp is defined well.
Someone write BNF of list. Here is my try.

List: "(" expression ")"
expression: atom | operator" "argument" "argument
atom: number literal
operator: "+","-","/","*"
argument: atom | expression

>The obvious solution is to make a *shitton* of lambda functions and simply match the user variable to a particular "return " function.
Why is that the obvious solution? Couldn't this be done in a single loop iterating over the json and user-supplied variable names?

Learn R.

btw I am enjoying learning LISP.

Attached: Screenshot 2019-08-25 at 1.00.02 AM.png (1838x240, 31K)