/dpt/ - Daily Programming Thread

Old thread: Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Attached: suave_lisp_toad.png (2880x1800, 562K)

Other urls found in this thread:

dlang.org/spec/iasm.html
github.com/protocolbuffers/protobuf/blob/master/docs/third_party.md
en.wikipedia.org/wiki/Free_Pascal#Examples_of_software_produced_with_Free_Pascal
pastebin.com/6fA28aBg
strawpoll.me/18263296
twitter.com/AnonBabble

funny how lisp zealots continually ignore Shen.

Stop shitposting in the OP, you stupid lisp-autist.
The OP should only contain cute anime grills.

Attached: 1561842346027.jpg (1000x1088, 175K)

>not anime OP
You know what to do lads. One less redditor on our site.

are you leaving?

No, but you will soon OP.

That's one gay as pic

Where does Windows 7 keep its C++ header files?

First for macros still have a place in modern sepples

Attached: Screen Shot 2019-07-02 at 10.15.12 PM.png (664x560, 89K)

Why are you shilling Shen?

because it's an interesting language.

i'm convinced the d shill, the nim shill and the shen shill are all the same guy

Maybe there should be an operator for showing how to interpret your type as a numeric type, that could simplify this the same way the spaceship operator simplifies comparison operators.

It's called casting

it depends on a fuckload of things
open up a dev prompt and check the value of the include environment variable
in general, it's
C:\Program Files (x86)\Windows Kits\[Operating System Version]\include\[SDK version]\[Library]\

oh also, [Visual Studio Install Directory]\[Visual Studio Year]\Community\VC\Tools\MSVC\[Version]\include

function Incr (Value : Unsigned_32) return Unsigned_32 is
Result : Unsigned_32;
begin
Asm ("incl %0",
Outputs => Unsigned_32'Asm_Output ("=a", Result),
Inputs => Unsigned_32'Asm_Input ("a", Value));
return Result;
end Incr;


What does inline asm look like in your language?

asm
{

}

>using a language named after a faggot trait
no, sorry
someone make a new thread

shan't be posting in this one until this is addressed

good riddance.

>named after a faggot trait
what's faggoty about LIStProcessing?

It's lithfrocessing.

font?

i strongly recommend the use of user-defined literal operators to greatly simplify construction of units from literal/constant values ("16_in", "3.5_ft", etc)

Would you like to share an example of how they intermix?

int foo(int x)
{
asm
{
mov EAX,x[EBP] ; // loads value of parameter x into EAX
mov EAX,x ; // does the same thing
}
}

sf mono

That's nice, I take it that's C? Would anyone else in the class like to show off their language?

Nope, D.
dlang.org/spec/iasm.html

>D
for dead

every time you make a dead joke, i only grow stronger.

I'm fixing some bugs in an open source clone of an old japanese VM/runtime. The original author assumed that the game text would always be 2-byte Shift-JIS, so English translated games (which use half-width ASCII characters) fuck it up. I think I've fixed all the really game-breaking stuff now, and I'm just trying to track down the smaller bugs (which are a lot harder to diagnose).

Attached: captain-bitch.png (640x480, 94K)

thanks

Attached: serveimage.jpg (1280x720, 50K)

for me, it’s c and lisp

For me, it's C and Haskell

for me, it's ada and c.

Based

You're like the 12th post.

For me, it's JS and sex.

I don't think being a webdev gets you anymore sex than not being one.

More like Hair--

>Lisp is the most powerful programming language.
Opinions, regardless of truthfulness to onesanon, do not belong in the OP
>What are you working on, Jow Forums?
Finished the ascii format parsing for .stl files. That function is too long to show how ugly it is. Here's a helper function that is just as ugly.

static bool ReadVec3FromString(std::string &str, GLfloat *vec)
{
//Success("vec3 string '%s'", str.c_str());
// split the string into 3 floats
std::istringstream vectorStringStream(str);
std::string valueStr;
for (int i=0; i

Attached: ascii_stl.png (1106x1040, 136K)

C++ template macros take 11 posts to compile

Is there a way to have a protocol buffer compile from the ".proto" file to a C Struct?
I'm having trouble making the C++ version work (I'm working on an embedded codebase), so if we get a C Struct from the protobuffer, then it'll work fine.

This is true

bite your tongue, heretic

Do you guys code on the Sabbath? I personally take that day off to read my documentation to make sure everything is making sense.

This is the daily programming thread, not the daily coding thread

I'm going to assume you're a heretic based off your attitude alone.

reading documentation is a form of work and is forbidden on the Sabbath.

not officially but you could check this list github.com/protocolbuffers/protobuf/blob/master/docs/third_party.md
or just do the sensible thing and switch to c++

I don't think so. It's like reading a novel and takes some notes to address later.

kill yourself

no i only code during weekdays at work, also it's called saturday

Thanks for the link! I think I'm gonna use the "nanopb" library for the C struct implementation.

>Do the sensible thing.
If only it were that easy. I've basically spent the last twelve hours trying to get the C++ compiler to play nice with IAR, and had absolutely no luck. Every time I fixed something, three more issues would pop up. Then, due to Windows's fuckery, I couldn't get anything to compile (since Google's PB implementation assumes you have all the system headers, which conflicts with the embedded code's pre-existing files).
Basically, it's a big mess, there isn't a documented solution online, and I couldn't get it to work, so for now, we'll do what works and stick with C, unfortunately.

Sorry for the long rant. It's just been a frustrating day.

>sensible thing
>switch to c++

Attached: $.gif (250x251, 1002K)

the official sepples protobuf interface is dogshit
you should make one to replace it

>when even Pascal has more notable software than Common Lisp
en.wikipedia.org/wiki/Free_Pascal#Examples_of_software_produced_with_Free_Pascal

Common Lisp code went to space. I don't think you can beat that. Plus Pascal was a college language taught to almost everyone when it came out.

inb4 no one asked. Here is the ugly function too.
pastebin.com/6fA28aBg

Attached: 1495597379087.jpg (449x600, 41K)

good luck buddy. don't know what your project is but using protobufs for embedded sounds like overkill to me.
what's wrong with it?

Genuine question. What would be the alternative? We essentially need to send things over ethernet, and the serialization/deserialization aspect of protobufs are why we began using them.

strawpoll.me/18263296

help me out pls

Attached: ren4.jpg (236x280, 13K)

>abstracting your protocol
why do people do this? Is it really that hard for people to serialize their own data? Once you make your own lib once you never have to again and it's a breeze to write whatever you want.

None of the above.

>what's wrong with it?
The generated code triggers warnings when you compile with stricter warnings (unfortunately it's in the headers so it propagates to everything that uses them). Library code should never do that; it forces users who want to enable those flags to use #pragma diagnostic around the include which may hide legitimate issues.
The interface is also not very idiomatic, with get_field()/set_field()/has_field() functions (iirc, it may be field() instead of get_field()). This, along with generally over-verbose identifiers, tend to make the code look more like Java than C++.
The code is also fucking gigantic, with a lot of implementation details in the headers (again see the bit about warnings).
That's just what I can call to mind right now.

Is K&R actually obsolete, or it that just a meme?

do this strawpoll!

Attached: ren5.png (1134x768, 1.3M)

It's fine but no longer covers the entire language. Find a supplement for C11.

which language does G-d use?

I did it and voted for something other than my favorite language
you should thank me with more weeb pics

meaning

i picked haskell
nyanpasu

json, xml, your own custom format
the main benefit of protobufs is being able to define rpc interfaces and generate clients for them in other languages, which makes it easier to write distributed systems.
>The generated code triggers warnings when you compile with stricter warnings
just loosen up
>it may be field() instead of get_field()
it is just field()
>The code is also fucking gigantic, with a lot of implementation details in the headers (again see the bit about warnings).
it has a shitload of features that are irrelevant to most people outside of google

>just loosen up
Sorry, not everyone writes pajeet quality google code.

>not saying God

fucking jew

How do I join the common lisp cool kids table?

Paul will show you the light.

Learn MMIX

python and c++ in either order. then actually write some useful software instead of learning memelangs.

C++ is the memiest of the memelangs, though.

Attached: 1557384757804.png (1920x1080, 1.35M)

>he reads documentation on the Sabbath
Infidels like you go in the eternal fire.

how the fuck do you get into Python? like truly understand what it is, books or tutorials would be nice.

Attached: pythonchan.gif (400x480, 85K)

step 1: Have things you want to script

Have a purpose in mind and find a tutorial tailored to that purpose. E.g., I wanted to learn python, and I wanted to learn about financial mathematics, so I bought a book titled something like "Python for Financial Engineering." Kill two birds with one stone.

uncalled for.

it's a pretty decent language if you have a practical mindset, so not most of Jow Forums.

But ShiftJIS is a multibyte encoding that is compatible with Ascii.

maybe they just took the lazy route and encoded it all using 2-byte sequences

Use the official documentation, the tutorial there is preddy gud. For each step make yourself a little project instead of just copying the stuff in it like a monkey. This is important so you can tinker about with shit. The more wrong you do, and then correct, the faster you learn. Make trying to get things to break in novel ways a constant side-project.

pasting an old program i made
#define b for(; Bob_Saget < fuckyou || !(fuckyou = 57); Bob_Saget++) { rape(Bob_Saget); }
#define o rape(Bob_Saget=fuckyou++-4);
#define please return
#define pussy ;
#define whore ;}

double rape(long long dick);

int fuckyou = 53;
short Bob_Saget = 49;
char deep_throat[2];
int main()
{


b o o b
please deep_throat[Bob_Saget *
fuckyou * Bob_Saget * fuckyou] =
fuckyou pussy whore


double rape(long long dick)
{
deep_throat [0] =
dick
pussy

while(dick == 0x3a){deep_throat[dick - dick] = 0x31;deep_throat[1] = 48.13037;
break whore pussy
puts(deep_throat) pussy
please Bob_Saget & fuckyou whore

That's not shiftjis then, it's a subset of shiftjis that only includes the 2 byte characters.

Learning C first makes you feel like a GOD when you learn Python. Problem with higher level languages is you don't learn the fundamentals.

Python is best for newbies and there's lots of jobs for it. Its also peak readable and comfy for scripting.

Oh yeah. I'd say go with Py first if you don't have a CS background. Otherwise you really should be learning C/Java first.

no I mean maybe they pre-padded single-byte sequences will a null byte, basically turning it into a 16-bit encoding with the same integer values as sjis

I voted Python on the condition that you learn a 2nd language and don't just stop there.

Have any of you looked through The Art of Computer Programming? If so, what do you think of it?

I might have to try that.