mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

9.6K
active users

A lot of blog engineering today, mostly doing smart #ed hacks and dealing with the consequences.

But! I came up with a way to include arbitrary files with #ed, so it's almost as powerful as #C #Preprocessor for my purposes! (Taking file name from buffer, modifying it into a reading command and then running another ed instance over this same file with this command. And using E command to read it back from modified file.)

Next: moving all the stuff I churned out to my HTML-ish format (that I should write about someday) and then to Server Side Includes (en.m.wikipedia.org/wiki/Server) for the sake of portability?

en.m.wikipedia.orgServer Side Includes - Wikipedia

REPOST (JAN 2024): My first thoughts on #Psion's dialect of Object Oriented C for the Series 3 and related portable computers.

Includes the JPI/Clarion #TopSpeed #compiler, a proprietary preprocessor, the Eiffel programming language, and a handful of calling conventions.

Also, did somebody say Objective-C?

This is an old blog post from the beginning of the year. If you've been following my journey in recreating #CTRAN, this was written a week before I decided to take the plunge.

hackaday.io/project/161291-the

(Yes, I did say in the article that I definitely wouldn't be writing a compiler. I did say that.)

hackaday.ioBeginning OLIB: An entirely uneducated look at Psion's proprietary Object Oriented C | Details | Hackaday.io<blockquote><strong>Me: </strong>I could do with a quick win to get me going again.<br><br> <strong>Also me: </strong>I shall learn a proprietary object oriented dialect of C, where the only way to learn it is to plough through 1150 pages of documentation.</blockquote> <p>Psion doesn't have a formal name for the object oriented version of C that it created for EPOC16. I've been calling it "Psion OO C", but the main library that it uses is called <strong>OLIB</strong>, which contains the root class. The others are:</p> <ul><li><strong>HWIM: </strong>The OO graphics library</li><li><strong>FORM: </strong>On-screen formatting </li><li><strong>XADD: </strong>Additional graphics library for 3a onwards (but not the Series 3 "classic")</li></ul> <p>To Psion's credit, their OO ecosystem is well documented in the SIBO C SDK across 5 books (hence the 1150 pages mentioned above). Each of the libraries has its own, dedicated book. There's also an "Object Oriented Programming Guide" which acts as an introduction to the whole ecosystem. I don't have the latest versions of all of these books - they seem to be lost to time. But I have all the 3 and 3a features documented, plus (I think) all of the 3c/Siena extensions. (3mx-era EPOC16 remains sadly undocumented.)</p> <p>What's nice about Psion's approach to OO is that they assume no prior

Class-building time for #ctran.

The compiler tutorials I've read don't talk about how to deal with classes and inheritance. I assume that a metaclass has to be built for each class. But should I then store those metaclasses for later use, or do I regenerate them when needed? I assume the former.

Also, my parser doesn't currently check for duplicate classes or methods (inside classes). Should it be in the parser, or should it be part of the thing that builds the output?

STM32. Процесс компиляции и сборки прошивки

Многие из начинающих разработчиков софта для микроконтроллеров реализуют свои проекты исключительно в средствах разработки, которые предоставляются производителем. Многое скрыто от пользователя и очень хорошо скрыто, из-за чего некоторые воспринимают эти процессы сродни настоящей магии. Я, в свою очередь, как человек в пытливым умом и природной любознательностью, решил попробовать собрать проект без использования IDE и различного рода автоматизаций. Так родилась идея для этой статьи: не используя ничего, кроме текстового редактора и командной строки, собрать проект мигания светодиодом на отладочной плате STM32F0-Discovery. Поскольку я не до конца понимал, как происходит процесс компиляции и сборки проекта, мне пришлось восполнять пробелы в знаниях. Разобравшись с этим вопросом, я подумал — а почему бы не рассказать другим об этом? Всем кому интересно — добро пожаловать под кат! 🙂

habr.com/ru/companies/timeweb/

ХабрSTM32. Процесс компиляции и сборки прошивкиМногие из начинающих разработчиков софта для микроконтроллеров реализуют свои проекты исключительно в средствах разработки, которые предоставляются производителем. Многое скрыто от пользователя и...

Sometimes there's a need to compile certain part of the code depending of the external factors like target OS or whether it's debug or release build. There is preprocessor directive #if that allows to wrap a part of the code the be conditionally compiled but there are certain disadvantages to using that:

📌compiler doesn't check the code that is inside #if directive when the condition is not true. That could lead to discovering an error once the directive changes to true due to other part of the system had changed.

📌with #if it's often that the directive would be inside the method at the call site, mixed up with the generic code which makes that harder to read

Conditional attribute can fix those problems. We only need to mark the method that supposed to be conditionally compiled into the code. We do not need to change the call-site and the compiler takes care of that. Also, the compiler still checks the correctness of the code that we have inside that method.

🚩Docs for preprocessor directives📑 learn.microsoft.com/en-us/dotn

🚩Docs for Conditional attribute 📑 learn.microsoft.com/en-us/dotn

Did you had to use those in your projects? If so please share ♻.

ICYMI: My first thoughts on #Psion's dialect of Object Oriented C for the Series 3 and related portable computers.

Includes the JPI/Clarion TopSpeed compiler, a proprietary preprocessor, the Eiffel programming language, and a handful of calling conventions.

Also, did somebody say Objective-C?

hackaday.io/project/161291-the

Replied in thread

@jhx You asked for it, so I'll answer it:

Imho, C++ design is broken from the very beginning. It wanted to provide #OOP language constructs, still maintaining full #C compatibility (which already failed many years ago, cause the languages took different roads).

It combines #exceptions (IMHO generally a bad idea) with explicit resource management (an *awful* idea, forcing you to use #RAII which will in turn mandates creation of purely "technical" classes, just to manage resources).

It wanted #generics, but that's impossible without breaking C compatibility, so it came up with #templates, actually a #preprocessor on steroids.

Overloading also doesn't fit into the simple C library ABI (where #linker symbols are named just like the function), so it came up with "name mangling" ... which is especially horrific because it is *not* standardized.

Ah well, I could go on 😂

404Not Found