/dpt/ - daily programming thread

procedural brainlets edition

Previous:

Attached: 1519358030758.jpg (567x800, 44K)

Other urls found in this thread:

github.com/edwinb/Blodwen
docs.idris-lang.org/en/latest/reference/ffi.html
twitter.com/SFWRedditImages

First for scheme

i want to build something in scheme. what do i make

Why do I see stuff like:
sizeof(char)
Doesn't the standard say it is 1?

nth for nim!

github.com/edwinb/Blodwen

Attached: 1539202523240.jpg (850x1190, 227K)

platform dependent

yeah, i check it twice a day for updates.

real progreammers fuck their keyboards

Attached: 1472592001030.jpg (1920x960, 183K)

A standard library so it's actually useful.

write your own meme lang

Want to, but too much of a brainlet right now. Plus I have way too many other projects ahead of it.

it's not that difficult desu if you don't mind it being awkward to work with

I'm just not confident enough in any language to warrant it. Still have huge impostor syndrome, especially with Idris because i don't get to use it as much as i want.

R7RS-Large will fix it.

i mean you don't have to write a full compiler, just a parser, type checker and interpreter

C++

foo(map) {
map.insert
// map has element here
}

func(map) {
foo(map)
// map blank here
}

map x;

func(map);


Why does my map become empty in func?

I want to learn spring boot and Angular. How do I start the best way. Especially Angular is crap

Had to change it to &map in foo

Should I learn Go if I'm a brainlet? If not, what is a brainlet approved language?

Go is a fine language for brainlets
The brainlet architecture is a new method of modularizing the traditional monolithic brain into smaller units that are more maintainable because they exemplify separation of concerns
Learn Go and cut up your brain

The only cool thing that you can reasonably build on scheme is scheme

>i mean you don't have to write a full compiler, just a parser, type checker and interpreter
writing an interpreter is trivial

for a simple functional language

Brainlet approved languages are Go and Python.

Your best bet if you are entirely new to programming is to learn Haskell in Emacs. I'd recommend any Haskell book that focuses upon algorithms and data structures to add confluence to your programming.

writing an interpreter is trivial for any language
you just have to add all the features and that takes some time and bookkeeping but it's not difficult

If my dick has to explain monads to one more GODDAMN robot...

>Python
I love Python

write a Java interpreter

That's not true. I'm building an mpd client in scheme and it's very cool.

Terrible advice. The first lang a newbie should learn is always python. End of discussion.

Maybe if you want the newbie to become mentally ill and incapable of proper programming and to go on to write articles about how its not fair fizzbuzz is too difficult

that was an interesting read

This. Haskell is the best medicine for brainlet-ism.

What's the best way to get a portable version of Python for Windows where I can still use pip, but it's all self-contained and the packages don't go into AppData folders. Is WinPython the best for that or is there something better?

idris is a pretty cool language, give it a try.

Except fizzbuzz is easy as shit in python. The tards who cant do a fizzbuzz in an interview are probably using C or some shit

>fizzbuzz
>difficult in C
Python programmer detected

>thinks people who get interviews cant fizzbuzz


someone is unemployed

I absolutely will, I'm rather interested in learning a proper functional language. Just not haskell.
Even though C++'s template language is a goddamned abortion of a programming language (and it is a pure functional programming language), once the pants on head retarded syntax clicked the paradigm itself was not only obvious and easy but fun.

Out of curiosity, what's idris's FFI like?

>idris's FFI like?
Haven't really messed with it much, honestly.
do_fopen : String -> String -> IO Ptr
do_fopen f m
= foreign FFI_C "fileOpen" (String -> String -> IO Ptr) f m

looks to be a bit verbose, but you get used to it, using Idris.
docs.idris-lang.org/en/latest/reference/ffi.html

How to determine whether it's more appropriate to use std::unique_ptr or std::shared_ptr ?
Say there is this object:
class Foo {};
class Bar {
Foo * foo;
};
class Foobar{
Foo * foo;
};
void FooBar (Foo &);

Bar will manage the lifetime of Bar::foo , while Bar may pass Bar::foo to both FooBar and fooBar .
Both FooBar and fooBar are guaranteed to be deallocated / return before Bar is deallocated.

Should Bar::foo be a std::unique_ptr or std::shared_ptr ?

First for procedural programing

oh hey we're back.
make any progress lads?

why site no work work

Help? how the fuck do i code a Carry Look ahead adder with generic width in VHDL?

Wrong

Since Bar is uniquely in charge of Bar::foo's lifetime, use a unique_ptr.

I am jumping headfirst into programming learning c# and Xaml for Xamarin. Step one is getting a mobile app portfolio going...

Am I fucked lads?

When can I into employment?

retard question here

will a structure value in c with no value still be allocated?

I don't get it. Why is it that when I put myIntArray=null. It doesn't necessarily delete the data on the original myIntArray? Yet mySecondArray would still point back to the original data set of myIntArray.

Attached: Arrays.png (460x347, 109K)

Sheeit i forget everything i knew about coding

What do you mean?

fine on my end

You mean like this?
your_struct x;
It will be allocated but it will contain random leftover values from memory afaik

Arrays are basically just pointers.

>I don't understand reference semantics

Help??? pls it's so difficult

And i'm not talking about the behavioral description, i want to do it in dataflow

I was thinking about using 3 nested for generate loops and a shitton of signals, would that be ok?

That's why i'm asking here, fucking dumbass.

all types that aren't primitives in Java are references
mySecondArray = myIntArray copies the reference, not the array
The array only gets garbage collected after no references to it exist any more.
(or more accurately, the object is unreachable because there exists no sequence of references that can be followed to reach it from any static or local variables)

Yeah, thanks.

>(or more accurately, the object is unreachable because there exists no sequence of references that can be followed to reach it from any static or local variables)
That sounds like it would be complicated to implement.

Not really, but you don't need to worry about it, it comes with the language.

It is. But that's what a garbage collector does.
It takes the set of all obviously reachable objects (those referred to by static or local variables), recursively adds all objects that can be reached via those objects, and then deallocates everything else.

Where would be a good place to get a programming mentor? Or at least someone I can bounce questions off of.

Basically /dgt/ and stacksoverflow should be adequate. Use Udemy for your daily courses.

Trying to continue the project for my class on my own.
I simply lacked the knowledge and experience with the language.
Hopefully I can finish this this year AND get ready for the next year's class.
I am really tired of working burgerflipping and shelf refilling and cleaning toilets and stuff.

Lisp is the most powerful programming language.

i wanna fug shinobu

Can someone recommend a good extension for haskell in vscode ?

no

probably the lang you're using's slack channel.

malbolge has a slack?

oh, well then you're probably on your own.
I know there's a few academia blogs for it though that go into decent detail.

to do what? try ghcid

Sounds slow.

>Or at least someone I can bounce questions off of.
That's what /dpt/ is for. Occasionally you even get helpful response.

Oh ok, thanks.

Why are you learning a joke language? Just for bragging rights? It’s super fucking counter intuitive and a massive waste of time and energy.

Should I learn lisp? I’m interested in studying artificial intelligence.

If allocations aren't used wildly it's negligible. If allocations are used like they normally are in GC languages it's slow.

IRC is also an option. I did mentor someone for fun once. It's a lot of work.

>If allocations aren't used wildly it's negligible.
But this forces you to think about memory allocation, whitch negates the reason to use GC in the first place.

Haskell Language Server

Exactly. I don't know of a system for not caring about memory allocation other than not using it.
The best I've found is to have separate pools with different timescales for cleaning. That's essentially just describing a small piece of intent at the risk of use after free for the careless. It's like a cheaper GC (1 instruction cleanup).

I only ever used Netbeans for Java.
Can I run them from like the console or something? How would I pass arguments like strings or integers from the console?

I mean lmao how can you lack KNWOLEDGE of language? They are all equal, if you know one you know anyone

Lisp AI meme is 20+ years outdated. For better or worse most modern AI research is done in Python.

Complete and utter bullshit.

>Complete and utter bullshit.
Complete and utter bullshit

cute vampire

>if you know VB you know Haskell

teljes és teljes szar

there are people in this thread RIGHT NOW who don't have at least one bitcoin

No, but if you know C you know Prolog Fortran Basic etc..
If you know Java you know C++

Basically you only have to learn the programming paradigm

you probably don't know any of these langs

...

Attached: Untitle1d.png (157x181, 31K)

lord, Mt. Stupid isn't even suitable for you.
You're just a straight shitposter.

All the good shit. Definition lookup, linting , integrated debugger and repl