/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

tutorialspoint.com/assembly_programming/
twitter.com/AnonBabble

is this the right /dpt/?

C# is literally the cutest language.

Too bad it's Microsoft only.

What do you mean?

C# is .NET language, and .NET is severely limited to MS platforms.

One of these

Anyone who hasn't actually tried hosting/running Mono on Linux should not respond.

You can target Mono or .NET Core, both of which are open-source and cross-platform.

See

I've used both Mono and .NET Core, and I have worked on live applications that use Mono and a myriad of microservices on .NET Core currently deployed at a mid-sized company.

>Mono
Some third-party implementation
>.NET Core
Not complete.

I wouldn't make anything .NET related if it's not on MS platform.

I think you should have placed "Code actively used by others" in the center.

>You can target Mono or .NET Core
Yes. In the same way you can target Wine when writing Windows executables.

If you write a program in C# on .NET and only later try to run it on Linux or anything else, you're going to have a bad time.

>Some third-party implementation
This is true, but Microsoft pays Microsoft developers to contribute to this projects.

>Not complete.
I agree, but it has worked fine for what I have deployed. I've got 10+ microservices using .NET Core sitting on an Ubuntu VM.

I'm certainly looking forward to .NET Standard 2.0, and in the longer term, Mono and the .NET Framework eventually merging into a single FOSS codebase (this has been hinted at by devdiv).

I love CODE too!! Lets code!

I suck.

...

I don't remember if I programmed 2D grapjics, maybe I did, but I decided to not check it

Contribute to a FOSS project by searching any small time github repo for common misspellings like "recieve" :^)

>I've got 10+ microservices using .NET Core sitting on an Ubuntu VM.
What microservices?

>and in the longer term, Mono and the .NET Framework eventually merging into a single FOSS codebase (this has been hinted at by devdiv).
I am deeply concerned, because I can't find why MS would do this. I don't understand profits of such move, if it's not good ol' EEE.

I think writing a self-balancing data structure would be better.

is writing a self balancing tree that hard ?

How have your retards not made a RB tree?

I just use std::map if I need one. I'm not a C toddler to reimplement every data structure by myself.

>What microservices?
All sorts of things. Some of them dig into Exchange mailboxes, determine various things, and injest/move the mail around to create service tickets, or notify admins if there's an issue with ticket flow. Other automation tasks to update counts on various licensed things based on API calls and information in internal databases. Some of them "talk" to each other, and one of them is a little ASP.NET frontend so you can log in and get some information without reading the logs.

>because I can't find why MS would do this
Where have you been for the last 5 years?

Microsoft is slowly open-sourcing all of their dev tools and making them much easier for people to use.

They've realized that Azure is their cash cow these days, combined with their persistent corporate licensing for on-prem things like Exchange, Active Directly, and SQL Server, while also having these things as cloud-hosted offerings.

Here's the "why": say I'm familiar with .NET, and know the ins and outs because the language and FOSS ecosystem is attractive. I need to deploy some servers/databases/data warehouses/lakes etc. into the cloud with all sort of ETLs and whatnot. If I know that Azure offers all of this with robust .NET SDKs, that's what I'm going to recommend to management.

In fact, all of this is making life easier for the developer, and if the developer is happy and can produce results, management will buy what the solutions architect recommends.

...

Wew

Functional friends i need your help.
First functional language (Idris)

>For example, to define a function which reverses a list, we can use an auxiliary function which accumulates the new, reversed list, and which does not need to be visible globally:
reverse : List a -> List a
reverse xs = revAcc [] xs where
revAcc : List a -> List a -> List a
revAcc acc [] = acc
revAcc acc (x :: xs) = revAcc (x :: acc) xs

feeling like a brainlet because after the prototype definition, im lost.
Could someone step through each line for me?

MIT uses an AVL tree as an example of a self-balancing tree. Also as it was mentioned earlier, there're plethora of libraries with data structures and algorithms.

>just use std::map if I need one
thanks c++14 retard

acc = accumulator

revAcc acc xs
reverses xs onto acc (acc ++ reverse xs)

They're both self balancing trees, so I don't know why you brought that up. Also you make them in the first year of college.

Well, I'll look into .NET infrastructure for Linux. Thanks.

to add:
= means =

revAcc acc [] = acc
when you apply the args acc and [] (an empty list) to revAcc, you get back acc

revAcc acc (x :: xs) = revAcc (x :: acc) xs
when you apply the args acc and (x :: xs) (a list which has a head x and a tail xs) you get back the result of a recursive call
revAcc (x :: acc) xs

So how would I call this in main to see an example?
I think iss understand better that way.

Use a REPL
you enter an expression and it prints the result


reverse [3,4,5,6,7]
or
reverse (3 :: 4 :: 5 :: 6 :: 7 :: [])

OOP is shit.

Ah, im a big dummy, i was over complicating it.
thanks mang

we know

What does the "s" in OOPs stand for?

shit

c# would be great if it wouldn't be for JIT

(You)

>mfw C++ is like C(leverest) but better

Designing an esoteric programming language called Nasenbluten. Here's Hello World.

Why didn't they call it ++C

...

I'm making a cpu benchmark tool for linux and windows. The only problem is that my benchmark only uses cpu0 and I want it to utilize all of the cores, do you have any recommended libraries I should use?

>gcc 7 when

Looks like Ook

it's called c++17 now.
think of it as (c + (+17))

m8... don't ask about libraries without saying which language or framework you're using.

>coercion
What languages still allow this in 2017

even asm doesn't allow this

>not having language native parallelism
wew lad

Get on my level

What's a good intro on machine learning?

Go back to your mind palace. The adults are talking.

Microsoft® Lisp 95

A lot of what I've done has been numerics or physics/math/engineering related. Take with a grain of salt.

Lisp a shit, literally a worse Scheme, it shouldn't even be possible to ruin Scheme but somehow they did it

I'm trying to learn ASM is it worth it?
(my first language desu)

>dynamically typed
>prefix notation because babies believe macros are only possible with homoiconicity
HAHAHA

>bait.bmp

God no
Pick anything else

>it shouldn't even be possible to ruin Scheme but somehow they did it
Obviously Lisp came out first and Scheme tried to fix it a decade later

Are you EE?

YES, but once you have a basic comprehension immediately ditch.

It's a useful learning exercise to better understand what exactly your code in languages like C, C++, Rust, etc. is going to compile into. I've found it very useful for reasoning about optimizations when programming in those languages. Other than that though: No. It's still used yes, but not by very many people and you're unlikely to ever encounter it.

I would recommend learning some higher level language and then going over it in vague terms to get an idea of what those languages are probably doing under the hood. The specifics of assembly are generally useless as they change from implementation to implementation.

>thinking homoiconicity is only used because of macros

Why is it used, then?

OH FUCK I DIDN"T NOTICE THERE WAS ALREADY LISP
have the other instead

language masturbation

>but once you have a basic comprehension immediately ditch.
sounds legit, what language do i learn after this?
i'm using this web
tutorialspoint.com/assembly_programming/
i don't know if it is a good resource i haven't coded anything yet i'm just reading all the basic stuff.

>Are you EE?
what's that?

I guess it depends on what you mean learn. If you want to get a conceptual understanding of 'machine code' (i.e. us syntax that just represent bits within a word), then I recommend a paired down version created @ my university, LC3. There are a few books as well as a windows IDE (lol) for it out there, and it's what we learned before going to C/C++/Python ect. It's based around 2 byte words/simple ISA/simple architecture. It was very cool writing LC3 assembly code and being able to trace its execution by hand through the HW.

I just learned that Swift had pattern matching. Suddenly my opinion of it is a lot higher.

Electrical engineer.
If you are not one, I think you'd better learn any other algorithmic language to take a grasp on what's programming is.
If you don't want to, well, good luck.

C#, Java, C++, Python, Javascript, any of them really. The skills are (fairly) transferable, it's just a question of what you want to do.

C#/Java for your standard desktop apps and enterprise development.

Javascript for web.

C++ for anything high performance, servers, embedded, games, etc.

Python is good to know no matter what you're doing, it's nice for making quick tests and pieces of duct tape to tie other software together, but is particularly popular in science.

This is a reasonable post.

Microsoft® Forth 95

>tfw couldn't formally complete half of the exercises from that one guys post about job questions for homework

>C++ for anything
This is a reasonable post.

No. There's no mention of any functional language (JavaScript is dysfunctional).

That's fine, those questions were shit.

>There's no mention of any functional language
I would imagine this is intentional.

So it's intentionally not forward-looking?

To add a bit more I forgot:

Java for Android.
Swift for iOS.
C# if you want to develop for both at the same time through Xamarin but beware, reviews of doing this range from "it's great" to "thanks Xamarin, now I have cancer". Also if you're commercial you need to pay for it. Kinda.

That's my personal opinion on the matter, I love C++ to bits and will attempt to solve almost every problem with it, but I wanted to keep it objective.

I wanted to focus on popular industry standard stuff, not academic curiosities. I also don't know much about functional languages, I've only ever done Haskell and I have fuck all idea what use cases to suggest for them.

>Also if you're commercial you need to pay for it. Kinda.
?

>I wanted to focus on popular industry standard stuff, not academic curiosities
Functional languages are hot in fintech right now.

They've restructured their bloody licensing page again in a way that almost suggests it's no longer true, but it used to be the case that if you wanted your app to be closed source, you needed to pay for a Xamarin license, making paid apps on the free license difficult but presumably making in app purchases and advertising still viable.
You'd need to look into it though, they claim it's now part of the Visual Studio Community license, which didn't impose any requirements upon source openness before, so I'm not sure what the story is.

I was unaware.

>C++
>embedded

I remember when embedded programming had limited stack depth, kb worth of memory and 8bit words.

Now it's writing shell script cron jobs for 1GHz ARM CPUs running GNU/Linux.

that's why C is literally irrelevant now.

>so I'm not sure what the story is
Then you should have said this in the first place.

You may have been thinking about the "Starter" edition of Xamarin, which no longer exists, due to Xamarin itself being FOSS, and the dev tools in VS included with VS.

The only potential issue you may run into is Visual Studio Community licensing, which is intended for those making less than $1,000,000 in revenue per year.

Not really. The last embedded programming I did was actually in C because the platform had only had a C compiler ported to it (as C++ is a much much larger standard). I said C++ in my post because if you learn it properly you'll basically learn C along the way. There was a whole office of us all doing different things in C on this thing, it's alive and well in some places.

I thought I knew what the story was, until I actually went and checked for further clarification. I apologize for not doing due diligence in my research for posts on a mongolian dishwasher maintenance forum.

Gotta catch 'em all

Can't imagine a rational reason to be against functional programming. It's just more principled procedural programming.

Angry OOP salesmen don't like it, because it reveals their snake oil for what it is.

Would probly break all the UML diagrams lol

>Angry OOP salesmen don't like it,
I like functional programming when I can use it in a language that lets me do straight imperative, and also use OOP if I want to.

>OOP salesmen
Name a single popular programming language that must be purchased to be used.

matlab