logo for basementcommunity

basement
community

search

wall of shame

software Creating a programming language

joined feb 22, 2023

avatar

Do not induce vomiting if swallowed.

joined feb 22, 2023

Recently, I've been working on a programming language of my own design (repo), and I was wondering if anyone else here has had any experience with this kind of thing. I'm pretty new to C (despite it being my titular language), but I've been learning dynamic memory management and thought this would be an interesting project.

I've mostly finished the lexer and abstract syntax tree data structures, and am currently working on the parser.

Got any any pointers (:P)?

Specific suggestions, syntax ideas/issues, and general comments on the structure of the project greatly welcomed.

posted 5/17/2023, 2:12 pm

joined may 24, 2023

avatar

one of the ten fools

joined may 24, 2023

Yo. I've made quite a few myself. Here's one.

I think the first thing to internalize is this - nobody is going to use your language, no matter how good it is.

These days making a programming language isn't just that. You need to have excellent tooling, community, and a really solid reason for the language to exist.

Even a bad language can go a long way if you nail: tools like formatter, linter, LSP impl, package manager and registry, etc. Look at Go. This is a lot of work - a full time job, basically.

That said, language dev is a lot of a fun and you'll end up with a solid understanding of language internals, and a cool personal tool you can use for your own software.

There's also a great community around this hobby: look up the r/ProgrammingLanguages discord server.

posted 5/24/2023, 5:42 am

joined jun 22, 2023

avatar

joined jun 22, 2023

If your language does not have any of the fancy features from DreamBerd, I'm not gonna use it but imma try it for sure. πŸ‘€πŸ‘€

posted 6/22/2023, 7:50 am

joined jun 15, 2023

avatar

[ 𝒖𝒔𝒆𝒓 π’Šπ’” 𝒃𝒂𝒏𝒏𝒆𝒅 ]

joined jun 15, 2023

This may be a controversial take, but recently in life I have taken a liking to BASIC-inspired languages. QB64, PureBasic/SpiderBasic, AppGameKit Script, B4X. I use them with static typing enforced and none of the old-school "goto" bad practices.

I have taken an interest in Ruby recently, because I want to have an interpreted language in my toolbox, but ending a block of code with "end" rather than just de-indenting it is much more palatable. I was so frustrated the last time I was coding something in Python because VS Code was tripping up over some imaginary indentation issue. Even the code reformatter couldn't fix it. I was begging to use curly braces at that point, though the reason I've grown to like using BASIC's endif, endwhile, etc. is because it's so simple at a glance to not get lose in a sea of either indentation or braces.

In short, my suggestions: static typing, non-significant-whitespace, cross-platform, and object-oriented as an option but not a requirement because I've discovered a ton of programmers, at least of the hobbyist variety, are not fans of OOP.

posted 6/23/2023, 2:01 pm

joined aug 27, 2023

avatar

joined aug 27, 2023

Your language should allow for easy creation and use of inline assembler code for whatever silicon you wish to adopt or adapt it to. The language's strong or weak typing system should allow enforced strong typing of the addresses, indices, and operands of the inline assembler code when looking at code inside a section marked as assembler. This allows someone with knowledge of the data types n widths inside a non sparsely filled array to do a bit of necessary bit banging.

please allow the creation of Non Sparse arrays as a default, most people like a completely available array with the memory penalty being superior to the overhead time penalty for checking if particular array entries have been assigned a value yet, creating a place ro store it, and adding it to a table of known array entries, or however the system deals with sparse arrays.

please allow multidimensional arrays, at the very least the kind with One data type and not the abomination type of array with differing data types.

also, lets not force everything be a function as in C. I dont mind if you want objects, instatiation of objects, and such but at least let memory management and object destruction be automatic- with an exception.

General purpose computers have hard drives and such for file storage- whereas specific use computers have static memory areas, these can contain encryption keys or constants and such and it would be very nice to force variables to exist in a place unaffected by power cycling.

A Fault tolerant operating sysyems like QNX could use a few new languages with neat features suggested by your other post responders.

posted 8/27/2023, 9:40 pm

joined aug 27, 2023

avatar

joined aug 27, 2023

include as many bit manipulations as you can muster, also matrix maths of scalar/complex/vectors of all types/quaternions in single varible forms up to matrices and operations on arrays of matrices. Sounds ridiculously extensive TBH but if it can reduce code and headaches for the programmer it Will be used by someone for it's ease of use. Coding those operations manually, checking and double checking and debugging them is a nightmare. I wish all languages had matrix maths, and at least complex numbers. Its a pain to do AC electronics without complex number math being part of the language. Its Absolute trash that the computer scientists creating languages and using the great advances in electronics that have been given to them by the electrical engineers and static state physicists and they dont even bother to have a properly full quadrant functioning Inverse Tangent function that doesnt need to be a coddled purely mathematically correct ArcTangent function.

posted 8/27/2023, 10:54 pm

joined aug 28, 2023

avatar

joined aug 28, 2023

user is banned.

Why bother? Why not simply use the divine intellect language given to you by the nephilim? Why clothes the wire with the cancer you reinvented? Perhaps you wanted to learn something out of it? Regardless the reason.. soon you will die.

posted 8/28/2023, 8:16 pm

joined feb 16, 2023

avatar

joined feb 16, 2023

The only advice I can give is, do what works for you. Trust your gut on this and just have fun working on it. It isn't likely to become a new standard but you never know. It could be like Linux "just a hobby project, nothing big". ;)

That said, if it does become a standard I am always reminded of this. :P

https://xkcd.com/927/

posted 8/31/2023, 9:20 am

software Creating a programming language