Share your repls and programming experiences

← Back to all posts
Copper, a open source programming language
gearDev (48)

I've always wanted to create my own programming language, so I started making one! This language is called copper because I like steampunk-themed stuff, and Copper is pretty steam-punky. There is more details in the README of the project. Here is the README anyway:


Copper

An Open source compiled programming language, In development.

Github

See the wiki here, also needs some work haha!
https://github.com/gearDev-code/Copper

Goals

Copper is an general-purpose OOP language.

Coppers main goal is to allow easy editability of its syntax, so programmers are in total control of how their programming
language looks without having to make their own.

Example:

Change the normal declaration of a variable in copper:

var: myvar $= `hello, world!`

To a python-like syntax:

myvar = "hello, world!"

Other goals

  • make the programming language easy.
  • make the programming language fast
  • make the programming language secure

Progress

I am still kind of getting into assembly, so the progress is slow

  • simple variables
  • Logging to the console
  • string/variable concatination
  • simple functions
  • functions in functions
  • OpenGL libs
  • OpenAL libs
  • Simple networking libs

(More will probably be added to the checklist later)

Problems

  • Functions and variables will do weird stuff if their names are four characters.

Contributions.

Not excepting contributions yet :(

Code Organization

The code in Coppers compiler is not organized as I would like it to be yet. I will be changing it soon.

Nasm

This programming language is not distributed with nasm yet, which it uses to compile to. You'll have to download it yourself currently.

Comments
hotnewtop
xxpertHacker (931)

Coppers main goal is to allow easy editability of its syntax, so programmers are in total control of how their programming
language looks without having to make their own.

So, consider this scenario: I, a developer who often uses Copper when programming, create a large program in Copper, so large in fact, that I create an entire GitHub repository dedicated to an A.I. program in Copper. Later, I encounter a bug, so I proceed to ask some other Copper developers that I know if they could help me out, yet there is a problem: although we all know the same language, we all write in different syntaxes, meaning we can't read each other's code as well, creating division between us.

My question to you is that, if we all write in drastically different syntaxes, do we really write in the same language?

Real-ish example: you write C++, I write C++; I wrote a program in a mutant variant of C++ here. Is it still C++, as you know it?

gearDev (48)

@xxpertHacker Hmm, good point... Most languages are similar in one way or another though. I should clarify that "syntax editing" does not include changing functions/method/module names just types, declarations, etc. Also if you edit the syntax, I would be able to edit it back to coppers normal/my preferred syntax (probably going to add a syntax translator). If you don't get what I mean, you will see in due time.

MatthewWesolows (35)

@xxpertHacker It could still work, think of Assembly, which has multiple different syntax (ex: Intel Syntax or AT&T Syntax) and manny differnt flavors (NASM, etc.).

xxpertHacker (931)

@MatthewWesolows Yes, but they all have their own hard set of rules.

To have every single individual's code be a different syntax sounds... idk...

Also, as for what you said about asm languages, they're not the same thing, they're just different assembler languages, as assembly language is more of a family of languages.

AmazingMech2418 (1102)

@gearDev It would probably be good to instead of making the syntax editing in the base language, have a base language and then a dialect transpiling system to go with it.

xxpertHacker (931)

@realTronsi Lmao, half of the team agreed that the project is dead.

I just used the C++ as an example.

Lmfao, the server doesn't even compile because I broke the file caching code and never fixed it. But sure, I'm definitely self-plugging right now.

Now, seriously, go click the link, read the three C++ files, and tell me that it's still "normal" C++ syntax.

realTronsi (928)

@xxpertHacker I mean it's still readable for me, but maybe because I know a bit of rust.

xxpertHacker (931)

@realTronsi Yeah, it's closer to Rust, but think about that, should it be closer to Rust, or should it just be idiomatic C++ instead? It's also mildly funny that it looks like Rust, but is actually loaded with memory lifetime bugs ;)

realTronsi (928)

@xxpertHacker idk what you're using though so idk, is it supposed to be an extension of C++?

xxpertHacker (931)

@realTronsi Lmao, I used the CPP (C-preprocessor) with C++, and a single GNU extension to use value returning ({ ... }) block scope.

Otherwise, it's just plain C++ ;)

Don't believe me? Check the compilation process yourself.

What you're seeing is what I call "rust.hpp," which started almost as a joke, but became a real thing.

realTronsi (928)

@xxpertHacker but you used stuff like mut, while in C++ it's mutable so watt

xxpertHacker (931)

@realTronsi C++'s mutable isn't related to Rust++'s mut.

See how it's already become unreadable when viewing it from the C++ perspective?

Read the entire rust.hpp file to understand it better.

If you have any extra questions, ask on the Repl, let's not cover this Copper post with this convo.

MatthewWesolows (35)

Very nice! Using assembly for the log is quite clever. My advice however, is to try to find alternatives. Using assembly in that way won't allow your language to be portable across devices with different processors and operating systems. But hey, the only things I've made are simulators and game related stuff. (It's also nice to see a fellow C++ programmer though!)

gearDev (48)

@MatthewWesolows Honestly, you probably know more than me. But I use nasm (net-wide assembly) and that is available for compilation on almost all devices, I think. (lol, your profile picture though)

Whippingdot (678)

bruh there are soo many C++ coders. @MatthewWesolows

xxpertHacker (931)

@Whippingdot Well... Replit is a Python community...

xxpertHacker (931)

@gearDev Asm languages are inherently not portable.

Nasm is made for Intel x86 CPUs. It won't work on an iOS device, on an Android mobile, on a Windows desktop, etc.

gearDev (48)

@xxpertHacker Oh really? Because I have a x64 machine and it works on here...

xxpertHacker (931)

@gearDev x64 code is usually portable to other x64 CPUs that use the same instruction set...

StringentDev (234)

I am also making an opensource Lang called hare. It will come with a pkg repo and manager, and should convert to ASMx86 and ASMx64.

StringentDev (234)

@gearDev the thing is we are compiling to all 64-bit platforms (win-x64, lin-x64, macos) via npm's (nodejs) pkg module :D.

We will in future be using github to compile the executables on release so we can do x86 releases too.

StringentDev (234)

uuuh it is on the momentum team
@firefish

firefish (953)

@StringentDev it shouldn't be on the Momentum team... I asked @Whacko to remove the repls

Whippingdot (678)

bruh i thought u knew not to put join links in a comment thread. now that you did this i HAVE to join now 😭 @firefish

Whippingdot (678)

ah you too smart the link is not valid 😭😭 @firefish

StringentDev (234)

yes. yes we are... but do you want to help out on Virra? @Whippingdot

StringentDev (234)

@firefish, (1) sorry for not being online today, been really busy, (2) can you invite @Whippingdot

StringentDev (234)

i invited you... it's pending. @Whippingdot

SudhanshuMishra (252)

Very interesting ..can u plz ping me whenever u post the update of this language :D

mollthecoder (34)

@SudhanshuMishra It can run now using the run button.

mollthecoder (34)

OpenGL and AL shouldn't be too high on the priority list.

Baconman321 (1103)

I seriously wish that I could make languages, but I'm a web developer and I don't have much to work with :sob:

Although, I am making a terminal lang in JS :D

Languages are fun but hard to make IMO.

gearDev (48)

@Baconman321 I started out with web languages, and I self taught myself every language I know (took a while though). Node.js would probably be easier for you to learn and work with if you wanted to create a language.

Baconman321 (1103)

@gearDev Yeah but it's slower.

I'd rather use C/C++/Go like ur using.

C sounds like a good language, actually... considering it's unsafe with memory management meaning that you have more control over it.

BranstinR (1)

it doesn't even run but it looks good

gearDev (48)

@BranstinR Yeah, lol, I added a running command so now you can run it i think. It compiles and runs the "test.cppr" script.

JBloves27 (1904)

Very nice! I like it's syntax, simple and easy to memorize! ;D

OldWizard209 (1603)

This seems to be pretty interesting @gearDev . Is there a way I can learn more about this language? Thanks

gearDev (48)

@OldWizard209 what would you like to learn? I haven't really worked on the wiki, but I will!

[deleted]

Haha, I made one before even you!

gearDev (48)

@GaneshaSharma Cool? what was the programming language called?

[deleted]

blang, you can get it at @GaneshaSharma and goto the runBlang repl, it's pinned @gearDev

Wuru (42)

I think it is time to release my language before someone like you creates something better...

xxpertHacker (931)

Not excepting contributions yet :(

Wait... so you are accepting contributions!? ;)

gearDev (48)

@xxpertHacker Yes, and sorry for the late reply, once I start accepting them every one will have to go through a long process including virus/malware test.

xxpertHacker (931)

@gearDev Ha, I was making a joke about the misspelling of "accepting" as "excepting," but since you're not denying something, technically you are accepting it.

gearDev (48)

@xxpertHacker oof, shhhh, I am a programmer, but not a pro-at-grammer

Bunnytoes (164)

I'm exited for copper! It seems like it will be really good