nitpicking: #embed is not a macro but should be a preprocessor directive.
thanks to
@thephd
@fasterthanlime ICYMI, if you can require a modern enough compiler, you can use #embed https://thephd.dev/finally-embed-in-c23
#include <stdio.h>
#include <stdlib.h>
int
main (void)
{
const unsigned char t[]
= {
#embed __FILE__ limit (128) /* C23 */
, 0, 0, 0, 0, 0, 0, 0
};
size_t s = 0, i = 0;
while (i != sizeof (t) / 8)
{
s += (size_t) t[8 * i + 0] + (size_t) t[8 * i + 1]
+ (size_t) t[8 * i + 2] + (size_t) t[8 * i + 3]
+ (size_t) t[8 * i + 4] + (size_t) t[8 * i + 5]
+ (size_t) t[8 * i + 6] + (size_t) t[8 * i + 7];
++i;
}
printf ("%#zx\n", s);
return 0;
}
Learn what embedded software is, how it works, key characteristics, types, benefits, and real examples in modern devices and IoT systems today.
Hey, wanna try out Zorn on your website, but don't use Astro? No worries, you'll now be able to embed Zorn on your non-Astro website using the all new Zorn Embed Generator. Please note that it's in beta, Zorn alone is not even stable but usable in most environments.
https://zorn.embed.sudovanilla.org/create/
The compatibility list of features and browsers has been updated for the Zorn documentation.
Okay, hear me out.
The game hardcodes all of its game data into .c files, but it still has an in-game editor: when the edits are saved, the game serializes the updated data out into C code -- or alternatively some data file that is #embed'd into the source -- effectively overwriting the existing hardcoded data.
This is stupid as hell, right?
(I'm gonna do it anyway.)
Very fun reading comments like "Björkus is just trying to C++-ify C" and the evidence presented is a bunch of C-exclusive things I'm doing that C++ doesn't have.
Fun to see accusations of not tamping down on undefined behavior when there's an entire "Slay Earthly Demons" series. I am even writing papers to do things like stop relying on implementation-defined/undefined behavior of the builtins for bit intrinsics (all accepted into C23 and C2y now), I am only person who's trying to stop spreading the array-style undefined behavior to more places (we recently accepted a proposal to add that undefined behavior into _Generic match now and I have to retroactively fix it) and I stood my ground against several vendors when they wanted Undefined Behavior in #embed if it didn't get used inside of an array initializer to prevent more UB from showing up during preprocessing.
At some point I just have to realize that the attitude of C is detached from the actual work we're doing in C. Maybe I can write an article to correct those perceptions but it's a lot of work and damn I've got a lot of stuff to do, constantly trying to just say "no that's wrong, man, are you even paying attention?" is kind of annoying.
@dotstdy @oblomov There is an interesting point here that I think is missing (which has a connection to IE in the Microsoft way). MSVC was originally not complaint even closely to C++98 but after many years of competition from clang and GCC (and ICC/EDG), MSVC is now inline with C++17 and even gaining support for c++20 and C++23/26 support.
Having a standard forced finally MSVC to follow the rest as developers started to have something else to use.
Now on the C side of things, things are slightly different. This is more due to Microsoft view that less Windows developers care about C and its features that is just specific to C. E.g. VLA support is not going to be ever implemented for MSVC (unless added to C++). #embed is being added because it is needed for C++ support.
Basically if a feature is added to the C++ standard from C, then it will be done for MSVC.
I am not sure if _BitInt support will ever be added to C++; though clang already implements it but GCC does not. I don't think there is a C++ proposal adding it yet; I have not seen one.
Разбираем net/http на практике: пишем веб-сервис DeadDrop для безопасного обмена сообщениями
Первая часть цикла «Разбираем net/http на практике»: создаём с нуля сервис DeadDrop — аналог Privnote для безопасной передачи самоуничтожающихся сообщений и файлов. На чистой стандартной библиотеке net/http разбираем основы: • запуск HTTP-сервера • маршрутизация в ServeMux • написание middleware (логирование и recovery от panic) • работа с HTML-шаблонами и layout’ами • подключение статики через http.FileServer и embed.FS В итоге получаем работающий сервер с красивой главной страницей, формой создания «ячейки» и базовой архитектурой проекта — всё без внешних зависимостей. Идеально для начинающих и тех, кто хочет глубоко понять внутренности популярных фреймворков вроде Gin и Echo. Пишем код вместе!
https://habr.com/ru/articles/981356/
#golang #go #httpсервер #вебразработка #туториал #middleware #template #embed #petпроект #backend
𝗙𝗶𝗿𝗲𝗽𝗿𝗼𝗼𝗳:
https://thewhale.cc/posts/fireproof
Fireproof is an embedded database designed to bring live data anywhere. Quickly add live data to any app or page with our embedded database, reducing risk, cost, and complexity with provable secure synchronization using any backend.
How To Embed Google Maps Location in WordPress Blocks Editor in 2026? 🗺 https://www.youtube.com/watch?v=UJDNV0UD5ws 🎬📌 #Embed #GoogleMaps #Location #WordPress #Tutorial
Astrophotographer Calls on X to Give Creators Control Over Embedded Posts https://petapixel.com/2025/12/16/astrophotographer-calls-on-x-to-give-creators-control-over-embedded-posts/ #astrophotographer #Technology #elonmusk #twitter #embed #News #x