/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

en.wikipedia.org/wiki/Common_Gateway_Interface
tour.golang.org
golang-book.com/
twitter.com/AnonBabble

First for Null-terminated Byte Arrays

I looked at a bunch of assemblers like MASM and FASM and GASM and they include lots of macro facilities that resemble C, like syntactic sugar for loops and functions and stuff.

Does that mean C is a macroassembler?

...

First for Ada

Absolutely haram

somebody PLEASE invite me to the /dpt/ discord

>using the modulo operator makes our code unmaintainable!

...

Assembly languages usually have same kind of simple macro system as C.
You define macro token and it expands into something.

3D arrays

business idea: instead of creating arrays within an array for a 2 dimensional n * m matrix, instead have a single array of length n * m where first n blocks are in column m = 1, blocks 2n to 3n-1 are in column m = 2, etc

radical enough that it might work?

From last thread:

I've been programming on and off for a couple of years now, and it's only been in Lisp with a functional style. It's great and I love it, but I want to try a new language. I'm having a lot of trouble trying to decide between C++ and C# though. I want a language that's cross-platform. I want a language with high-level features. I want a language with a lot of ready-to-go libraries available and documented (Scheme-inspired minimalism is great but a huge pressure point when I work on larger projects and have to roll things entirely by hand). I don't want to spend time allocating memory if I don't have to.

I was going to go with C#, but it feels like there's a lot of turmoil going on with .NET/.NET Core/.NET Standard/Mono and all of these frameworks don't seem to inter-operate smoothly. I really don't want to deal with that. Then I was thinking of C++ but I know it as a very clunky language with a lot of manual memory management and I don't want to deal with it. However, it's been around for ages and so has a shit-ton of libraries for a lot of things and is very stable even when standards are updating. However, I've heard that "modern C++" or C++14 and 17 actually reduce the memory and pointer management you need to do by a lot and even have lambdas and so on. One person mentioned that they rarely had to manage memory at all and felt that contemporary C++ was like having a high-performing scripting language. That sounds hyperbolic, but I'm more open to trying it

What should I do, /dpt/?

isn't that how 2D arrays are optimized anyway?

It would be trivial to write a wrapper for a UTF-8 native string with the only overhead being the addition of a regular array where each array member is a pointer to a null terminated string containing a UTF-8 character.

Does rust even let me do something like this?

don't think too hard, just learn both.
toss a coin for which language to pick first.
once you learn one, the other will be easier.

nodejs

why trust a compiler to do it or not when i can do it myself?

tranny posters need to hurry up and kill themselves like all mentally ill trannies eventually do

good point

>Does rust even let me do something like this?
Depends, have you checked your privileges and donated to SJW causes?

>radical
Maybe if this was 1950

what if you had a huge matrix though. surely allocating a massive chunk of memory would create more problems than many smaller ones + one indirection for each access

If I have language that has no webserver but it has interface to C, is there some library I could just write bindings for developing web backend in my lang?

A C program only needs to output HTML to stdout to serve webpages, look up CGI scripts

You mean like attaching your application to a web server?

It's old but you can probably get by with CGI
en.wikipedia.org/wiki/Common_Gateway_Interface

>old
There's nothing old about using CGI scripts.
Creating stateful web applications through POST and GET strings is the only way to play in an age where you have literal retards writing javascript ON THE SERVER.

i can't imagine that actually happening

Can you link me some projects in Common Lisp done functionally and well?
Preferably small ones.

Parameter "Y" of function "Whatever.m" has undefined type

What the fuck is this

in java, do i need to pass a "ClassName()" attribute as a parameter to a "ClassName()" method? or can i access that attribute without passing him as parameter?
not sure if my questions makes sense, but i'm quite confused with oop

looks like an error message

HolyC?

>Welcome to Sup Forums's read-only JSON API documentation.
Fuck.

I want to learn Perl and I want to git really gut with it, what should I read? Can someone point me into the right direction?

do you want bots?
because that's how you get bots

>Can someone point me into the right direction?
forward

I'm a recently turned Lisp fag, and I've been using the loop macro too much.
I just can't find other ways to do what I want.
AM I doing it wrong?

>wake up from a coma
>it's 2017
>there is that tech company
>this company is worth several billions of american dollars
>this company's main product is irc with a new face stuffed in a chrome engine

so um
what other old as shit concept should one rewrite, sprinkle with emojis and pack it with Electron to be worth several billions of american dollars?

uml is a retard idea

Imageboards.

Not sure if this is right thread but there's no thread on this sort of thing. What's the best courses in edx to pay a certificate for? I know almost everything's free but I want to know which courses are worth paying for

Rating system they have doesn't help btw. Wondering if you guys have any recs

OOP is a retard idea.

My manager keeps assigning me tickets to speed up crappy old code. He never gives these sorts of tickets to anyone else in the team. Why does he do this, and what can I do about it?

>boy
S O U R C E ?

ok, so anonymous imageboards with emojis
with dropbox, slack and asana integrations
in a desktop Electron app

with paid options to host your own private corporate imageboard to let your employees vent a little

ok, I'm on it. Thanks user

I mostly used Scheme languages, where pretty much everything is functional by convention. However, I don't think there's going to be much of a difference besides syntax/style and libraries if you go from there to Common Lisp. They both heavily leverage return-by-default, values, higher-order procedures, etc. Just pick a project with a lot of stars on GitHub in a Scheme language and then translate it to Common Lisp if you want some practice.

obliterate his progeny

You'll make hundreds

I'm not interested in learning more than one language at a time. It seems like both languages have a lot of difference in how they approach problems, so if I'm going to learn one I'd like to spend the time to learn whichever one I choose as thoroughly as I possibly can instead of trying to half-ass both.

why haven't you learned Go yet?
tour.golang.org
golang-book.com/

Chapel is better in every way.

I don't understand.

Common Lisp has loop and collect. I don't use CL much though. Racket Lisp has takef, dropf, (take a predicate and a list, analogous to takeWhile and dropWhile), take, and drop, for-each, etc.

My media database thing is coming along well. The media viewer zooming/panning is now nice and smooth and I got libvlc all figured out, so it can play all sorts of video/audio files, render subtitles etc. So now basically any media type aside from PSD/RAW images and other stuff like that can be viewed. I need to add a better way to categorize things on top of tags though, like AoT doesn't have v# in the filename so it can't be searched by volumes.

Anyone else get serious brain fog with a little bit of disassociation at around 8pm after programming all day?

Too bad Racket doesn't have the libraries I want.

Rape his daughter.

kys degenerate faggot

oop is good by nature but corrupted by society

everyone does, it's called "tiredness" and some "sleepiness", probably

That sucks. What kind of libraries are you looking for? Libraries have definitely been a pain point for me as well in Lisp languages (I'm the user looking into C++/C#).

Brain fog sounds like me after I've abstained from coffee for 36 hours.
It goes away after another few, afterwards, I'm free of the coffee dependence.
But then i start again the next day.

The disassociation, what is that?

OOP is inherently flawed, though.

>The disassociation, what is that?

Basically when the world starts "feeling" less real than it usually does.

>libvlc
>not libmpv

Yes, that is trivial to do. You're wasting a lot of space by doing that however.

This is bullshit.

>not vanilla ffmpeg

sounds like clinical depression

though seriously, I feel weird after having programmed for over 6 hours nonstop.
Basically you get really tuned in and it's hard to "get out of the computer".
It's not really ideal either, because by this point, I'm not really productive either.
You should take breaks.

VLC master race

At this point why not adopt UTF-32?
It's slightly less wasteful than what you're asking.

Why aren't more people using Lisp?

It predates C, so it means I would have to relearn programming, because all modern programming paradigms worth using in 2017 come from C.

it's not very good

Neither is Java, but it is widely used.

Maybe Java is better than Lisp

>slightly less wasteful
Do you know how large a pointer is, and how much overhead there is with tiny heap allocations? UTF-32 would be significantly more efficient, especially when you consider pointer dereferencing overhead like TLB misses.

I've crashed Matlab 3 times doing basically nothing. How do they get away with charging small fortunes for it?

>store n-polygonal numbers P(n,N) for 2 < n < 9 into 8 arrays
>traverse and search for numbers that are permutations of each other between the arrays
>???

Of all the wrong things I've seen posted on /dpt/, this is one of the most wrong ones.

Did you ever consider that string indexing isn't even that important of an operation? Most of the time you just iterate over ever character in the string.
I highly doubt your stupid memory hungry UTF32 is going to help much. You're making it so you can fit FAR less shit into the cache, which might even cost as much as just iterating over the fucking string.

This, also consider that a pointer is likely to be 64 bits.

What does Sup Forums thinks about "Think Python" book?

Should I use it?

I agree, but you have to admit that Rust not having O(1) character indexing in strings makes for a great meme

Does Rust have dependent types yet? If not then there's absolutely no point in using it.

array indexing in rust would let me write a trivial solution that seeks out the Nth UTF-8 character in a utf-8 string by returning a pointer to it's starting point.

>seeks out the Nth UTF-8 character in a utf-8 string
This is not a common requirement. Easy unicode and i18n is much more important for most applications.

>100MB json file
>sublime text uses up to 700MB of ram
>takes half an hour to load on an i7 4770

anyone want to like help me just like fix computer

Does Haskell have stack pointers yet? If not then there's absolutely no point in using it.

Stack pointers are a meaningless concept in Haskell because it doesn't use a stack.

Install Gentoo, slut.

if gentoo can be put into an iso less than 4mbs and have an sshd or serial console then yeah

That means Haskell is meaningless.

C++, template metaprogramming scratches the same itch as Lisp macros. You'll feel horribly limited in C#/.NET weenie land.

>takes half an hour to load on an i7 4770
things that never happened

>100MB json file
>open it in vim
> 1.5 seconds to open

git gud pleb

pls resbond

>8 arrays
I really don't follow. And the problem with searching is keeping track of indices and false-candidates, e.g P(1,n), P(2,n), P(3,n) could be cyclic, but so can P(1,n), P(2, n), P(3,n + 4), so you need to save the path. Or a set can all be cyclic save for the last element with the first. Anyway, I figured it out, but it took over 10 hours of rewriting code and questioning my sanity, and also feeling like an incompetent imbecile.

are animu posters the best programmers?

T A I L R E C U R S I O N

(but for real fuck it, CL is mostly imperative)