/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous Thread:

Other urls found in this thread:

youtube.com/watch?v=vMVGH2c_AVs
open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf
repl.it/JJQK/0
twitter.com/SFWRedditVideos

Did any of you ever start that programming puzzle/challange general that was talked about a few months ago?

>REMIND

>programming puzzle/challange general
Link to archive?

Has he even released TOS or HolyC to the world yet?

cia african american

Homoiconicity is Schemes greatest strength

The source is available for download, as it always has been

My language has a very similar syntax to lisp except I use {} instead of parenthesis because my parenthesis keys are broken

Many Scheme languages allow you to use {} inplace of (). It in no way affects the simple beauty of Lisp.

>modern compiler implementation in java
Ah yes, a fine read JBlow

Should I write my web server in racket?

just relaxing,writing an irc bot plugin on a language i don't understand at all and listening to chill beats

good fridey night

link? why does everyone here have a boner for blow

its literally just been me shitposting for a few days.
youtube.com/watch?v=vMVGH2c_AVs
~1:18:00

wait, are you the same guy who said that jai is DOA because jblow has a weird opinion on DRY?

>weird
he says he doesnt believe in it, and yes.

Web assembly will herald in a new future where C is compiled to WASM bytecode and sent to your web browser.

A new era in malloc bugs, off-by-1 segmentation faults and the extinction of reflection.

You've made your bed now sleep in it.

my language does this:

push_ctx buf_size 128
do_stuff
pop_ctx buf_size


this basically makes buf_size act like a global variable but just between the push and pop instructions.

any criticism?

Don't have it.

Couple of anons were trying to solve programming challenges on sites like codeforces.com or spoj.com, trying to bring down the time and space complexity of their solutions, making the solution as simple as possible, etc.. Loads of people were down on having a general just for this. A challenge gets posted in the thread, and anons attempt to solve it together. You learn a lot about different data structures, math, optimization, etc by solving these, but it's incredibly difficult.

>C

web homosexuals will compile from rust, as they like cocs

>Web assembly will herald in a new future
no it wont.
People arent going to port their house of cards node.base.
Webdevs dont care about optimization.

What language should a person, who wants to make shitty programs for a hobby, learn? Not for job or money.

what do you think about metaclasses
open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf

>global
Little out of your element, pajeet.

>classes
>sepples
literally who cares

New Modern Imageboard
>ReactJS frontend
>Imgur hosting
>Decentralized , DHT esque or IPFS based
>JASON API served by gin-gonic and stormdb

Y/N?

python for web/quick projects/desktop applications/artificial intelligence/text processing/data processing
C for embedded
Assembly for reverse engineering/exploit developement/game hacking
Luajit+Love2D for 2d games
C++, unfortunately, for 3d games
HTML+CSS+Javascript+Python for web developement

>>ReactJS frontend
>Decentralized
>jason
nah m9, im good

Did you not see Modern?

If you want a classic board there's plenty. Or even just text board for you.

This is modern. Embrace it.

uninteresting combination of generics, macros, d style mixins, reflection

every part of this screams "a fucking meme" at me

>Modern

The latest in meme technology, that's for sure

I have been reading a lot how good is Lisp for learning how programming works. Should I get into that first?

I have basic knowledge of HTML and CSS so Python does seem a good choice for all around language

there is nothing modern about json or JShit

Its gonna be fun man. Its modern !
Iwant every autist to be able to start their own image board node with one command.

What do you want? Raw Bytes? Or BSON?

Or a custom data structures?

Also ReactJS is nice for UIs

>I have been reading a lot how good is Lisp for learning how programming works. Should I get into that first?
I personally didn't like lisp*. I liked the idea of it, and I seriously wish every language had a more lisp-like syntax, but after actually giving it a good try i really didn't like it.

*I actually tried chicken scheme and racket, not lisps, but the ideas should be similar

I want JS to die, and all sites to stop using it.
Not sure, but I know json is ass and needs dropped as well

I agree but there's nothing else that controls the browser DOM like JS.

Maybe Dart... But I think that compiles to JS.

What's wrong with JSON? What do you recommend?

Benchmarking SDL2.

>I agree but there's nothing else that controls the browser DOM like JS.
this "cant beat em,join attitude is why webdev is such a shitshow.
JSON is ugly and slow.

So its a good idea or not?

Dude I'm already using a NoSQL db and a Go webserver. I'm not joining any fad.

But yeah if not ReactJS I may look at Dart now.

>Go
>not a fad
How can Rob Pike be so based and yet get something so fundamental wrong?

hi /dpt/ if a young programmer wants to work as such what should he learn?
my guess is C something, java, javascript, amirite?

Hes not writing C 2.0 for nerds

He's writing Python + C 2.0 for brainlets

>winshit

>java
if you want to be a code monkey
>javascript
If you want to be a web code monkey

how does it handle recursion

First time in flask and whipped this up. It's very simple but i'd like to expand on it with a dynamic web-based ssh and other tricks.

How do people do web design changes today? About a decade a ago I was using dreamweaver for class, is it still used and viable? Any better alternatives?

Going to start pushing Flask for any gui related projects because fuck cx_freeze and pyqt clusterfuck.

no one cares what technology you use to make it, just how good it is

It sounds awesome. This should become a thing.

You'll need familiarity with, in no particular order
C, it's used in everything
A basic primer in assembler (x86 or ARM)
An OOP "business" language, like Java, C++, or C#
A lisp-like language, like Scheme, Common Lisp, or Clojure
An ML derived language, like Haskell, F#, or Scala
A high-level scripting language like Python or Ruby or Perl or even VB.NET (it's gross but it gets a lot of use)
The native scripting language for your OS (PowerShell for Windows, Bash for everything else)
You'll also want to touch on SQL, Regular Expressions, and most likely at some point the languages of the Web (HTML, CSS, JS)

The important thing is not to pick one flawless language, but rather to choose a wide variety of tools, that you can adapt to different problems. If you pick one language from each of these categories, you should be well equipped for everything that can come at you. When it comes to picking a language from these categories, pick the language that is native to your system (if you're on Windows, stick with F# and C#)

True. I may drop the decentralized part and just stick to traditional web protocols.

Welp here goes my Friday. Basically nextchan was good but was an unpolished piece of shit.

Understand basics of C/or brush a bit on C++ and then go to python.

I've been telling /dpt/ for years now that native applications are ded and web dev is the future.

how does what handle recursion?

I'm writing a streaming server that uses popcorn times scraping api to download and stream movie/shows according to a vote system.

The back end is complete, written in python. Any recommendations for a nice frontend webapp framework?

Right now im playing with flask, but I don't really like the template syntax.

The only non-meme frontend framework is bootstrap

Reminder that if you cast the return of malloc in C you need to reconsider your life choices.

Why?

no.
the next thing that will come is, you'll have a java interpreter made in web assembly, embedded in your browser

Hey that's pretty nice lad, thanks.

awesome

trickd u bro

Every other web front-end framework comes and goes, like dust on the wind, but bootstrap remains

>java
*haskell

you tricked yourself by putting that shite on your machine.

What are some projects to look at for good examples of "modern" C?

>"modern" C?
doesnt exist.

Looks the same as it always did, senpai.

The most recent revision is 2011, and you still don't see many of those practices in people's code.

Oh, come on. There must be some good examples out there of how to write readable, modern, secure C code

Like I said, it looks the same as it always did. The same idioms that were used in C89 are used now. C is for Constant.

>implying

if you're not using stdint these days, you might as well kill yourself

God user you're a moron. People are far too generalist all the time. It's so obvious. Who could possibly argue against that nowadays?
And computers need specialized solutions. JAI is the first language I see that actually offers you good ways to do this. An example that was brought up recently was hashmaps. They're an interface that can have lots of implementations behind them all for good reasons. Yet people insist on writing general code for them. If we're to have that we need the expressive power to preserve the interface to then while adding a convenient way to modify them to fit the special case. The modify proc (not a JAI expert, whatever lets you alter the function/struct body based on metaprogramming procedure calls) is the cleanest system I've seen for this.
It's trivial to reach any use case for the hashmap with no runtime cost. C++ can do it through templates. But just imagine writing a templetized hashmap that has key and value as pairs. An array of keys and arbitrarily allocated values. Values wrapped in any variety of smart pointers. A hashmap that allows you to invalidate keys while keeping the values in a way that's not horribly error prone. All of these variations is just not sensible to do in templates. You absolutely should go for external metaprogramming tools for that.

And even so, this is all assuming we need to _NEVER_ repeat ourselves. Its an extremist position that's poorly motivated. Having to put in code changes far and wide is bad. But DRY generally covers way more than those cases. You're encouraged to couple completely separate systems together just because a subprocess is similar (at the time of writing, not necessarily after maintaining/extending code).

stdint is the ultimate reason why c89 is shit

read the draft std
look at annex K
you can find the SEI CERT docs with google
stop using gets

Rate:

type Board struct {
ID string
Owner string
ShortName string
}

type Owner struct {
Name string
Password []byte
Owns []Board
}

// There are no Users only posts
type Post struct {
Poster string // Namefagging
Avatar url // Avatarfagging
Anonymize bool // Default. Anonfagging
}

repl.it/JJQK/0

Quake 3s GPLd source.
I don't think it's necessary pretty after the styling they've done for the open source release. But as for the actual code and systems it's great.

>. But just imagine writing a templetized hashmap that has key and value as pairs.
i can already do this

>mfw ree-tards say neural networks are the way forward in ai research
reminder that if planck's hypotheses are true the universe itself is a cellular automaton so technically cellular automata have already solved ai because there's us

You're an idiot.

Looks cancerous

> Poster string // Namefagging
Anonymize bool // Default. Anonfagging
just let an empty string be anonymous

There's no point in doing it, you get the proper type from your lvalue.

>stops there
Obviously writing one version is trivial. Writing all these versions (the list goes on) is going to be a proper mess. A hash map isn't even a complicated datastructure where there's many options. You've generally got two choices in how you store your values (buckets being common for a general implementation and other options being less common) and then you have a million ways to store your keys and values in relation to each other, different requirements on iteration. The list goes on. It's not a trivial implementation even with good facilities to help you. But it's completely doable with good facilities.

I personally haven't seen a generic hashmap implementation that covers a lot of these cases. People either decide not to go for it because it'd break their nice generalization or they make a specialized version.

I say JAIs DRY support is better than most languages. The stuff (that I sadly haven't seen demoed yet) about adding capture lists to blocks is amazing for DRY. Allows you to easily and safely move from an inline implementation to a function call implementation. Though Jblows focus seems to be on assisting with thread safety with that feature. Which is also good i suppose.

The real question is, which (if any) non TOS compilers support Holy C? I want to use it outside of TOS.

...

>no book coming out of academia is actually going to tell you what's a good idea when implementing a compiler
Wew. Shots fired, general academia.
>He doesn't compress his input data where the inputs would produce the same outputs
Not a good idea. You wish to limit inputs as much as possible. If you only accept 1 or 0 as input you give an error for everything else immediately. You don't pass it through your program and catch the error late.
Likewise here you should clear the string when the string is equal to the default string (assuming you don't want any special significance to inputting anonymous as the name, which I do all the time by the way, along with sage).

>the same output
It's not the same.

lol

What is the intended output when you enter the same name as the default name?

One is namefagging and one isn't

>internal transform detail
So what's the output?

Just fork meguca.

>ads
wtf faggot?

I just told you.
One of them is namefagging and one isn't.

There are ads on Sup Forums. Where is the problem?