Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "backticks"
-
Ahhh I've hit 1800 points, if anybody likes any of my posts or comments, I'm coming for you, and I WILL change all your inverted commas for backticks.6
-
It's weird that devRant, being a developer-centric platform, doesn't support `preformatted text`.
I just want to put `code` in backticks and stupid code snippets in triple backticks.
I think it's high time we adopted markdown. Can someone please take this issue #27 up from 2017? It's 2020 FFS!
https://github.com/devRant/devRant/...6 -
I'm incredibly ticked off by decision of using backticks ´ to define template strings on es6...
template strings are nice , but backticks are irritating ugly and unreadable3 -
TIL the ` character is known as the 'grave' character
meanwhile my 🤡 ass has been calling it 'back tick' this whole time...
🤡🤡🤡🤡🤡🤡🤡🤡🤡12 -
Am I the only one missing ``` // some code ``` backticks/tags (the ones that convert wrapped text to monospace code) here? @trogus -- Since this is a dev-oriented community.. could this be an area to improve devRant?2
-
Coding on a German keyboard suddenly gives you a reason to like those indentation-based languages without curly braces. And what about backticks and single quotes, they're for sure easier to find on an American ASCII keyboard. Fücking ümläüt chäräctersß!
Even worse on a Mac where it's not even printed on the keys what they do when holding shift, alt, or apple/clover/cringle keys.24 -
Trying out the new version of fasm, I realize it's good, and conclude I should update my code to work with it as there's small incompatibilities with the syntax.
So, quick flat assembler lesson: the macro system is freaking nuts, but there are limitations on the old version.
One issue, for instance, is recursive macros aren't easily possible. By "easily" I mean without resorting to black magic, of course. Utilizing the arcane power of crack, I can automatically define the same macro multiple times, up to a maximum recursion depth. But it's a flimsy patch, on top of stupid, and also has limitations. New version fixes this.
Another problem is capturing lines of code. It's not impossible, again, but a pain in the ass that requires too much drug-addled wizardry to deal with. Also fixed in new version.
Why would you want to capture lines of code? Well, because I can do this, for instance:
macro parse line {
··match a =+ b , line \{
····add a,b;
··\}
};
You can process lines of code like this. The above is a trivial example that makes no fucking sense, but essentially the assembler allows you define your own syntax, and with sufficient patience, you can use this feature to develop absolutely super fucking humongous galactic unrolls, so it's a fantastic code emitter.
Anyway, the third major issue is `{}` curlies have to be escaped according to the nesting level as seen in the example; this is due to a parser limitation. [#] hashes and [`] backticks, which are used to concatenate and stringify tokens respectively, have to be escaped as well depending on the nesting level at which the token originates. This was also fixed.
There's other minor problems but that gives you sufficient context. What happens is the new version of fasm fixes all of these problems that were either annoying me, forcing me to write much more mystical code than I'd normally agree to, and in some rare cases even limiting me in what I could do...
But "limiting" needs to be contextualized as well: I understand fasm macros well enough to write a virtual machine with them. Wish I was kidding. I called it the Arcane 9 Machine, A9M for short. Here, bitch was the prototype for the VM my fucking compiler uses: https://github.com/Liebranca/forge/...
So how am I """limited""", then? You wouldn't understand. As much as I hate to say it, that which should immediately be called into question, you're gonna have to trust me. There are many further extravagant affronts to humanity that I yearn to commit with absolute impunity, and I will NOT be DENIED.
Point is code can be rewritten in much simpler, shorter, cleaner form.
Logic can be much more intricate and sophisticated.
Recursion is no longer a problem.
Namespaces are now a thing.
Capturing -- and processing -- lines of code is easier than ever...
Nearly every problem I had with fasm is gone with this update: thusly, my power grows rather... exponentially.
And I SWEAR that I will NOT use it for good. I shall be the most corrupt, bloodthirsty, deranged tyrant ever known to this accursed digital landscape of broken souls and forgotten dreams.
*I* will reforge the world with black smoldering flame.
*I* will bury my enemies in ill-and-damned obsidian caskets.
And *I* will feed their armies to a gigantic, ravenous mass grave...
Yes... YES! This is the moment!
PREPARE THE RITUAL ROOM (https://youtube.com/watch/...)
Couriers! Ride towards the homeland! Bring word of our success.
And you, page, fetch me my sombersteel graver...
I shall inscribe the spell into these very walls...
in the ELEVENTH degree!
** MANIACAL EVIL LAUGHTER ** -
I don’t know about you but I use backticks for every string in js. I want to know that I can always use quotes and apostrophes and backticks ensure this. Also they allow templates and Babel got me covered when it comes to old browsers.
I don’t see the reason why should I use something but backticks in 2020
Again,
` — kiki
“, ‘ — boubas17 -
Almost finished with latest preprocessor.
Why am I always working on preprocessors tho? Shit...
Anyway, almost finished ok.
Idea is, basically, that inside a C source or header you can write a perl subroutine instead of `#define ...`.
The mechanism is rather simple:
```C (wat?)
macro mymacro($expr) {
· // perl code goes here
· return "$expr;"
};
```
`$expr` is just a string holding whatever block of code comes after an invocation of `mymacro`. You can use the builtins `tokenshift` and `tokenpop` on a string to get the first and last token, respectively, and then `tokensplit` gives you *all* the tokens.
Whatever string you return is what the expression you received is replaced by:
- You can just give back the expression as-is to get the exact same thing you wrote -- so `mymacro char* wat;` gives you `char* wat;`.
- But if you return a galaxy's worth of C code, then bam. Macro expanded into it, just like that. It's a perl subroutine, so let your imagination fly. Wanna run some scripts at (pre)compile time? Then you can.
- If you return an empty string, then puff. No code. Input consumed.
- If you give the name of another macro (eg "another_macro $expr;"), the expansion recurses.
- If you return the name of the currently executing macro, no recursion happens. This lets you wrap C keywords without (too much) fear.
It's kind of cool because a separate perl module is built from the macros themselves. So then you can include those in another C file. Syntax is basically more perl because why not:
```C (yes)
package mypkg;
· use lib "path/to/myshit/";
· use pm funk qw(mymacro);
```
The `lib` bit actually translates to `-I(path)` for gcc. But for some reason the way you add an include path in perl is `use lib "path"`, so yep. I get it's confusing but just go with the ::~ f l o w ~:: ok.
Then the `pm` stuff is not valid perl (i think), but I took the easy way out and invented it to ensure there is a way to say "OK I don't give a single shit about the C stuff, just give me these qw()'d funky macros from this file." If you simply `use funk qw(mymacro)` then you also get an `#include "funk.h"`.
Speaking of which, headers are automatically generated. Yeah, fuck you, I added `public` to C, bite me. It's actually quite sexy as I defined it using the preprocessor:
```C (yes but actually perl)
macro public($expr) {
· my $dst=cmamout()->{export};\
· tokentidy $expr;
· push @$dst,$expr;
· return "$expr;";
};
```
Where `cmamout()` is a hash from which the output is generated. Oh, and `tokentidy` is just a random builtin that cleans up extra whitespace, don't mind it.
So now the bad stuff: I have to fix a few things. For instance, notice how I had to escape a new line there? Yeah. It's called dumb fix to shit parsing, of course.
But overall I'm quite satisfied with this. And the reason why may not be so obvious so I'ma spill it out: backticks, motherfucker.
That's right. Have a source emitter written in an esoteric language?
```C (yes really but not really)
macro bashit($expr) {
· my ($exe,@args)=tokensplit $expr;
· return `$exe @args`;
};
```
So now you can fork off into parallel dimensions; what can I say pass the pipe brother.
MAMmoth in the room is yes, this depends on MAM. What is MAM? MAMMI. It's the original name of my infamous picture of an ouroboros eating it's own ass while stuck in limbo contemplating terrible life decisions of a build tool, avtomat (go ARSLASH <AR/> [habibi]).
So what's the deal with that? avtomat is a good build tool _for me_, not... ugh, you. I made it for *myself* baby things are not going to work out between us I'm sorry. MAM just does lots of things I wanted build tools to do in the __EXACT__ way I wanted them done. I'd say you should go use it too maybe, but actually don't and you shouldn't because I broke main some weeks ago to fix some other shit and then implement this. Yeah, pretty stupid, but what the hell. I'm the only user after all!
In conclusion, I am fully expecting to receive my mad props and street cred in the mail along with your marriage proposals en masse, effective immediately.
Further reading: https://youtube.com/watch/...