[–]▶ No.843159>>843175 >>843212 >>843223 >>843383 >>843478 >>843637 >>848753 >>848775 [Watch Thread][Show All Posts]
>a language as simple as python
>that lets you distribute an executable to normalfags and not have to install python
what is it?
▶ No.843161
▶ No.843162>>843164 >>843187 >>843205
Just use py2exe or whatever then
▶ No.843164
>>843162
This.
Also learn to green-text, faggot.
▶ No.843167
▶ No.843170>>843187
You distribute Python you dolt.
▶ No.843171>>843174 >>843187
AFAIK all distros and even MacOS already have python, so you don't worry about it
▶ No.843174
>>843171
you underestimate the shittiness of pip
▶ No.843175>>843187
>>843159 (OP)
>not have to install python
it's already installed on all sane distros you dumbass
▶ No.843176>>843181
>as simple as python
so a poorly designed sack of shit that's spent its entire life progressing from "Guido does obviously stupid thing but it's OK because Python = ez" to "community hacks on a complex fix for stupid thing but nobody think about what this means for the language lol"?
Just pick any language that deploys well to the platform you have in mind. If you're effective in a language as bad as Python, then you'll do fine in other bad languages.
Anyway I hear normies like web browsers :^) You should probably bundle a web browser with your app.
Anyway it depends on what you actually want to do. Neither deployment or language are the barrier you think they are. What will your executable do?
▶ No.843181>>843183
>>843176
i am writing an anime visual novel generator from scratch
▶ No.843183
>>843181
and you are aware that RenPy and Visual Novel Maker already exist?
▶ No.843187>>843188 >>843240 >>843318 >>848763
>>843170
great way to add 20 megs of download and unnecessary minutes of install.
>>843171
>>843175
normalfags don't use *nix systems you autists
>>843162
this is the correct answer if you wanna distribute Windows binaries
▶ No.843188
>>843187
>py2exe is the correct answer
>distributing python isn't though
you... how do you think py2exe works?
▶ No.843198>>843258
C. It's Python for non-pajeets.
▶ No.843200
python has forced indentation, so it sucks anyway
▶ No.843201
javascript and bundle it with electron (chrome)
▶ No.843205
>>843162
Enjoy your program halting execution and strange bugs. Better write directly in C or even c++
▶ No.843212>>843408 >>843483
>>843159 (OP)
C#. It's basically Java minus the requirement of having Java installed.
▶ No.843222>>843233 >>843234
▶ No.843233>>843235
>>843222
This is terrible:
elif i=="(":
appendToken()
curType="oparen"
curToken=i
elif i==")":
appendToken()
curType="cparen"
curToken=i
[...]
Program declaratively. Do something more like this, for example:
types = {"(": "oparen", ")": "cparen", ...}
if i in types:
appendToken()
curType = types[i]
curToken = i
elif ...
If you write the same bit of code multiple times you're almost certainly doing something wrong.
And for the love of god, read PEP 8 all the way through and follow it.
▶ No.843234>>843236
>>843222
Also:
>We're not gonna be like Python and make countless different objects just so we can make dictionaries, we'll do stuff all with mutability and if the user makes it so the hash changes that's their problem they should've copied it with the copy operator before making it a key
If the hash of the key object changes, how does lookup work? You'd have to move the item every time that happens. The hash is used to index memory. The data structure breaks if you do that.
▶ No.843235
>>843233
Yeah I know the transpiler is a horrendous mess, I'll clean it up when it actually implements the entire language (because I need to reimplement it in the language itself then).
▶ No.843236>>843237
>>843234
If the hash of the object changes it's the user's problem.
▶ No.843237>>843393
>>843236
You said that already. What I don't get is what your language will even do if that happens.
Does it look up with just the hash? That would make it significantly less powerful than Python's dicts, because you can't retrieve the keys.
▶ No.843240
>>843187
>great way to add 20 megs of download and unnecessary minutes of install.
Their fault for using Windows in the first place.
▶ No.843276
▶ No.843279
▶ No.843318>>843321
>>843187
>normalfags don't use *nix systems you autists
who cares about normies?
▶ No.843338>>843654
>>843223
Freebasic gets quite close to the mark, as it gives you a clean .exe that depends on nothing pretty much.
The only disadvantage is that it don't support mac computers.
▶ No.843353>>843357
I can't believe none of you fags said Rust yet.
>Easy
>Fast
>Compiles to native
>Safe
▶ No.843357>>843380
>>843353
One of the four is not correct at all.
▶ No.843380
▶ No.843382
>>843321
>2017
>developing for normies
unless you make good money on it, it's a crappy endeavor.
▶ No.843383
>>843159 (OP)
I dislike python a lot.
▶ No.843386>>843388
>loops are not in brackets
what a meme language
▶ No.843388>>843390 >>843394
>>843386
One of the major reasons why I really dislike Python. Its one of those retarded "everyone can kode :D" languages.
▶ No.843390
>>843388
Accessibility is only a problem if it makes the language worse in other ways.
▶ No.843393>>843418
>>843237
It'll be undefined behaviour, what will happen in my implementation though is it will just no longer be able to find it, it might be retrievable again if the hash table gets resized, but if there were collisions then anything it had collided with would be moved to the new place too. My dictionary implementation looks up first using a hash, then using a comparison check (both of which can be user defined), usually only one comparison check is needed unless there were hash collisions.
▶ No.843394>>843415
>>843388
How exactly does this make the language worse?
Give at least one practical example (code) which suffers from this (inability to use brackets instead or in addition to indentation).
▶ No.843408
>>843212
underrated b8 post
▶ No.843415>>843419 >>843420 >>843422 >>843524
>>843394
>be in college
>here goys learn python
>classmates dont understand nested loops
Plus it looks ugly without brackets. Python is one of those retarded "different for the sake of being different" languages.
▶ No.843418>>843423
>>843393
That's a really terrible design decision.
Just automatically copy objects when they're used as keys.
▶ No.843419
>>843415
>retarded "different for the sake of being different" languages
That is not a thing. Languages look different because of their lineage.
▶ No.843420
>>843415
Are you saying that they would understand nested loops if Python used brackets? It really doesn't make a difference. This is a problem with your classmates.
Python's use of whitespace for control flow is copied from ABC. It's not a decision for the sake of being different.
▶ No.843422
>>843415
Just as expected, you have nothing to back up that bold statement. Go eat a dick.
▶ No.843423>>843426 >>843430
>>843418
Copying is slow and not needed half the time. Implicitly copying is also unclear and inconsistent considering regular function are just pass by reference.
▶ No.843426>>843440
>>843423
>Copying is slow
bullshit
it depends on the data size, dereferencing is also not free, do you know?
▶ No.843430>>843440
>>843423
Is your language supposed to be sanic fast as a primary goal?
If not, it's definitely not worth the undefined behavior.
▶ No.843440>>843442
>>843430
It's up there as one of the main goals (which is why it's transpiled in the first place as opposed to interpreted), it's preceded by:
1. Dynamic typing
2. Garbage collection
3. Object orientation
>>843426
I'll be dereferencing either way.
▶ No.843442>>843443
>>843440
In that case it's not worth it. Copy keys if they're mutable. Give a way to explicitly opt out of the copying if you feel you really have to.
▶ No.843443>>843445
>>843442
The user can copy keys if they want with an @ (the deep copy operator), but I'm not going to go slowing down a program for what might be no reason half the time because the user probably won't try to modify a key in the first place.
▶ No.843445>>843452
>>843443
A miniscule slowdown is several orders of magnitude less bad than undefined behavior.
Is everything an object? Are all objects mutable?
▶ No.843449
Too vague to answer. The main two questions for OP should be: a) Is your program going to have a GUI? b) Does it have to be in an interpreted language? The first question is really the make-or-break. I'd say to look for something with Qt bindings as it's fairly easy to quickly whip something up.
Go has bindings for it, last I checked, and it's a compiled language designed to be easy to pick up (but GC and no generics). If you still want an interpreted language and are concerned with the distributable binary size for some reason, pick Lua (but with some issues like dodgy Unicode and 1-initiated arrays). Also, why can't you just get your normalfag audience to install Python? It's as easy as installing a regular program.
▶ No.843452>>843454
>>843445
>A miniscule slowdown is several orders of magnitude less bad than undefined behavior.
I disagree, if you want something like that you should be using Python. Miniscule slowdowns add up.
>Is everything an object?
Yes, just like Python.
>Are all objects mutable?
Yes, part of the reason for this is that you can attach attributes to objects (like you can with user defined objects in Python, except you can do this with ALL objects). If you do
x=1 x+=1
(and yes, that syntax is correct btw) for example, it's still the same object, it's just storing a different value.
▶ No.843454>>843457
>>843452
Have you thought this out?
a = 1
b = a
b += 1
Now a is 2. Unless you implicitly copy during assignment, that is.
And there's a non-trivial difference between "b += 1" and "b = b + 1" if you do it that way.
▶ No.843457>>843463
>>843454
That's exactly what's supposed to happen.
If you were to do something similar in Python, but with a list, the same thing would happen, what I've done is made it consistent throughout.
The object stores the data, it is not the value itself.
▶ No.843463>>843464
>>843457
It might be intentional, but that doesn't make it any better. Even trivial programs now don't work the way people would expect them to based on just about every other procedural programming language. Nobody wants this.
C makes a distinction between pointers and plain values. Java makes a distinction between objects and primitive values. Python fulfills the expectations people have of plain values by making some objects immutable.
They all address the need in a different way, but they do all address it. You're not addressing it.
I could dump @ symbols in front of all cross-variable assignments, but it would be annoying and it probably wouldn't even be as fast as Python's interning.
▶ No.843464
>>843463
>Nobody wants this.
But I do and the language is designed for me to use.
>You're not addressing it.
Because 'addressing' it means I need to add inconsistency, I don't want to have to remember every exception to a rule, I just want to have to remember a rule.
▶ No.843471>>843473
Does it count if it's simpler than Python? If so, Pascal.
▶ No.843473>>843476
>>843471
Is it a simpler language or is it simpler to use?
▶ No.843476
>>843473
It was used to teach programming, so it's about as simple. It's not interpreted, though, so YMMV on ease of use. But with Free Pascal you can actually produce binaries for different platforms on your own.
▶ No.843478>>843490
>>843159 (OP)
if you're developing for normalfags you put it on the (((app store))), they don't know how to double click an executable anymore and their os won't let them install exes from strange men anyway
also just use renpy ffs
▶ No.843483>>843559
>>843212
I'm falling for it but I'll take, "what is the .Net framework for 400."
▶ No.843490>>843534 >>843543
>>843478
>they don't know how to double click an executable anymore and their os won't let them install exes from strange men
>mfw this is actually what it has come to
▶ No.843512>>843546
I guess Tcl would work, since it's designed for embedding into C program. Then you just build C skeleton and ship it.
▶ No.843524>>845970
>>843415
It's kinda stupid to use Python as a teaching language anyway. It's a fucking bloated-ass scripting language with tons of abstractions and stupid OO syntax, all of which muddies the waters. Old school BASIC was much more transparent and direct. You didn't get no stinking fancy data structures, besides multidimentional arrays. You want a stack or a queue? Build it yourslf, hoser! That's much better for learning, because you don't just use a fancy language feature or import a library to implement what you should be doing manually in order to learn.
Then one day some overrated idiot wrote "goto considered harmful" and then everyone dropped BASIC like a lead balloon, right on top of their heads.
If they were going to switch from BASIC, they could have at least moved to Scheme or Forth. That would have actually made some sense. But let's not delude ourselves here. School, including university is not about learning, it's about creating an endless supply of corporate drones that can be plugged into the machine like so many cogs.
▶ No.843534
>>843490
What's the next step I wonder...
▶ No.843543
>>843490
>won't let them install exes from strange men
This is actually progress though.
▶ No.843546
>>843512
>Tcl
Meh, it's dead and manages to be even uglier than Perl.
It was probably nice for interfacing C with Tk back in the day, but I would rather use something else now, like with C with Lua, C++ with Qt or GTK, or Go.
If you want to distribute your software to normies, it's better to do it in binaries.
▶ No.843552
This guy's post history is hilarious
>how do I make a math game for kids
>I've been learning for ten years mastering my craft
>mocks everyone that recommends an engine
>then makes pong in unity
▶ No.843559>>843565
>>843483
Normies already have the .NET runtime because they've installed Telemetry 10. It's not like Java where even on Loonix it's not there by default because of how absolutely shit it is.
▶ No.843565>>846003 >>848776
>>843559
OpenJRE is included in Debian by default
▶ No.843637
>>843159 (OP)
I see the autists haven't been able to give a remotely useful answer, as usual.
> Normalfags
> Needing to install python
You're talking about windows, so: try AutoIt or Autohotkey.
You're welcome.
▶ No.843646>>845977
▶ No.843654
>>843338
(Free) Pascal then?
▶ No.845970
>>843524
No idea what you think they do at schools, but when I did comp we did need to implement stacks and queues ourselves, without using the built-in libraries
▶ No.845977
▶ No.846003
▶ No.846005>>846084
>>846002
Can you elaborate?
▶ No.846084>>846094
>>846005
Are you fucking autistic?
print("Hello World.")
int main() {
printf("Hello World.");
return 0;
}
▶ No.846087>>848992
PHP.
Come hate me and call me pajeet you niggerkikefaggots.
▶ No.846094>>848643
>>846084
What about this one?
import requests, sys
files = [('files[]', open(f, 'rb')) for f in sys.argv[1:]]
for file in requests.post("https://mixtape.moe/upload.php", files=files).json()['files']:
print(file['url'])
▶ No.848643>>848671
>>846094
Here you go faggot:
#define __STDC_WANT_LIB_EXT1__ 1
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
int main(int argc, char **argv){
WSADATA wsa_data = {0};
if(WSAStartup(MAKEWORD(2,2),&wsa_data) != 0){
puts("Failed to start WSAPI");
return EXIT_FAILURE;
}
SOCKET sock = {0};
if((sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET){
puts("Failed to create socket");
goto error;
}
const char *addr_str = "www.mixtape.moe";
ADDRINFOA *host_addr = NULL;
if(getaddrinfo(addr_str,"80",NULL,&host_addr) != 0){
printf("Failed to find address %s\n",addr_str);
goto error_socket;
}
if(host_addr->ai_addrlen != sizeof(SOCKADDR_IN)){
puts("Incorrect address size!");
goto error_addr;
}
SOCKADDR_IN *addr = (SOCKADDR_IN*)host_addr->ai_addr;
if(connect(sock,(SOCKADDR*)addr,sizeof(SOCKADDR_IN)) == SOCKET_ERROR){
printf("Failed to connect to %s (%s)\n",addr_str,inet_ntoa(addr->sin_addr));
goto error_addr;
}
printf("Connected to %s (%s)...\n",addr_str,inet_ntoa(addr->sin_addr));
for(int i = 1; i < argc; i++){
FILE *fp = fopen(argv[i],"r");
if(!fp){
printf("Failed to open file %s: %s\n",argv[i],strerror(errno));
continue;
}
printf("Opened %s...\n",argv[i]);
(void)fseek(fp,0,SEEK_END);
size_t fs = ftell(fp);
(void)fseek(fp,0,SEEK_SET);
#define POST_BOUNDARY "----deadbeef"
#define POST_HEAD_FORMAT \
"POST /upload.php HTTP/1.1\n" \
"Host: www.mixtape.moe\n" \
"Content-Length %d\n" \
"Content-Type: multipart/form-data; boundary="POST_BOUNDARY"\n\n"
#define POST_BODY_FORMAT \
POST_BOUNDARY"\n" \
"Content-Disposition: form-data; name=\"files[]\"; filename=\"%s\"\n" \
"Content-Type: application/x-object\n"
#define POST_FOOT \
"\n"POST_BOUNDARY
#define POST_HEAD_SIZE sizeof(POST_HEAD_FORMAT)+20
#define POST_BODY_SIZE sizeof(POST_BODY_FORMAT)+MAX_PATH
#define POST_FOOT_SIZE sizeof(POST_FOOT)
char post_body[POST_BODY_SIZE] = {0};
char post_header[POST_HEAD_SIZE] = {0};
snprintf(post_body,POST_BODY_SIZE,POST_BODY_FORMAT,argv[i]);
const size_t body_size = strnlen_s(post_body,POST_BODY_SIZE);
const size_t content_len = fs + body_size + POST_FOOT_SIZE;
snprintf(post_header,POST_HEAD_SIZE,POST_HEAD_FORMAT,content_len,argv[i]);
const size_t header_size = strnlen_s(post_header,POST_HEAD_SIZE);
const size_t post_size = fs + body_size + header_size + POST_FOOT_SIZE;
uint8_t *post = calloc(1,post_size);
memcpy(post,post_header,header_size);
memcpy(post + header_size,post_body,body_size);
fread(post + header_size + body_size,fs,1,fp);
memcpy(post + header_size + body_size + fs,POST_FOOT,POST_FOOT_SIZE);
if(sendto(sock,(char*)post,post_size,0,(SOCKADDR*)addr,sizeof(SOCKADDR_IN)) == SOCKET_ERROR){
printf("Failed to upload %s\n",argv[i]);
}
puts("Uploaded the file!");
char rec_buf[800] = {0};
if(recv(sock,rec_buf,800,0) == SOCKET_ERROR){
printf("Failed to receive URL\n");
goto skip_url;
}
printf("%s\n",rec_buf);
skip_url:
fclose(fp);
}
puts("Done!");
freeaddrinfo(host_addr);
closesocket(sock);
WSACleanup();
return EXIT_SUCCESS;
error_addr:
freeaddrinfo(host_addr);
error_socket:
closesocket(sock);
error:
WSACleanup();
return EXIT_FAILURE;
}
Now, this code would work if mixtape.moe didn't require (((SSL))) encrypted uploading, but I just didn't feel like adding that feature in, cause I already spend a couple hours on this program, i'm sure you can figure that part out. So right now it just 403's at you.
▶ No.848671>>848672
>>848643
>200 lines and 7 libraries to replicate 4 lines that doesn't even work because he can't handle TLS
You sure showed him. :^)
▶ No.848672
>>848671
>7 libraries
Only two, C standard library and Windows Sockets API. If I used something like libCurl I would have done it much easier. Also it's only 120 lines and he uses much more libraries than me.
▶ No.848753
▶ No.848763>>848773
>>843187
> 20 megs is a problem for users of a system that downloads and reinstalls 1gig of directx whenever you install anything graphical
Okay
▶ No.848773>>849006
>>848763
I don't think that I've ever had a DirectX reinstall, let alone something 1GB. Direct3D is updated whenever you update your graphics drivers, since the implementation of Direct3D is supplied by your GPU vendor.
▶ No.848774
>even bothering with this retard
you must really have the mentality of a sand-nigger to leave the trash fire that is /g/ and then want to form the exact conditions here
▶ No.848775>>849179
>>843159 (OP)
how has no body said scala yet
▶ No.848776
>>843565
>Java is shit
>OpenJRE is (maybe) on Debian
Seems like a potentially logical marriage then.
▶ No.848778
▶ No.848992>>849006
>>846087
Can you compile it to an executable?
▶ No.849006>>849275
>>848773
it doesn't change anything about the fact that they are bloated.
>>848992
even if you could compile feces and urine to an executable, it would not mean you should use feces and urine.
▶ No.849179
>>848775
Because OOP is for pajeets and normies.
Which are you?
▶ No.849275>>849279
>>849006
Do you think graphics drivers on Linux are less bloated? You have the option of the generic graphics drivers like MesaGL that are probably not hardware accelerated, or a bloated driver from Nvidia or whatever, so you have the same problem when you want to do "anything graphical". I can just use the generic video driver that comes with windows if i'm concerned with drivers being bloat. I wont play some AAA game with that but neither will the non-bloated Linux graphics drivers.
▶ No.849279
>>849275
mesa is hardware accelerated, it handles all hardware acceleration for intel gpu's now and i think it's handling radeon too, or atleast it can handle radeon.