ruhr.social ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Eine Mastodon-Gemeinschaft rund um das Ruhrgebiet und die Menschen dort. Diese Instanz wird ehrenamtlich von Enthusiasten moderiert und technisch betreut.

Verwaltet von:

Serverstatistik:

1,5 Tsd.
aktive Profile

#codegen

1 Beitrag1 Beteiligte*r0 Beiträge heute

Is anyone using Apple’s OpenAPI code generation in an iOS app? I did some testing and compared it with other OpenAPI code generators for Swift, and honestly, it doesn’t feel quite right for an iOS app.

It’s very (very) powerful and solves issues like server-side generation and while the generated code is correct, it’s not very pleasant to work with. For example, compare @a_grebenyuk’s CreateAPI with Apple’s generated code, and you’ll see the difference.

#apple#swift#iosdev

Just released a new version of the polyglot data structure & bindings generator for hybrid #WebAssembly, #Zig & #TypeScript apps/interop. Now also supporting externally defined types for which only stubs for alignment & sizing are required, but which otherwise are opaque and can be used as any other type defs in this toolchain (e.g. embedded in structs/unions or as pointers, slices, arrays etc.)

thi.ng/wasm-api-bindgen

thi.ng/wasm-api-bindgenPolyglot bindings code generators for hybrid JS & WebAssembly projects

Be careful when updating your swagger-codegen dependency, you might want to avoid
version 3.0.57 and stay with 3.0.56; fortunately my #unittests detected the problem
before breaking more, but it took me some time to find the cause and that an issue
has been opened already three weeks ago:

github.com/swagger-api/swagger

GitHub`@NotNull` is added by default for fields that are not required · Issue #1295 · swagger-api/swagger-codegen-generatorsVon yeikel

So I have an interesting case where the Rust compiler decides to not inline a hardware intrinsic for aarch64.

This of course generates real sub-par code to do a call, but has other effects such as the code surrounding the call gets slower as well (setup of stack frame, store/loads to stack, etc)

godbolt.org/z/7sEna5TGv

The C version of the same code has no issues.

godbolt.org/z/4MPjcsf9z

Thoughts?

godbolt.orgCompiler Explorer - Rust (rustc 1.76.0)use std::arch::aarch64::*; const TILE_WIDTH: usize = 64; const TILE_HEIGHT: usize = 60; const SCREEN_WIDTH: usize = 1920; struct Color16 { r: i16, g: i16, b: i16, a: i16, } struct Tile { x: i16, y: i16, } #[no_mangle] unsafe fn blend_bg_tile_neon(output: &mut [Color16], tile: &Tile, bg0: &[Color16], bg1: &[Color16], alpha: i16) { let tile_x = tile.x as usize; let tile_y = tile.y as usize; let mut buffer_offset = tile_y * SCREEN_WIDTH + tile_x; // splat alpha into a vector let alpha = vdupq_n_s16(alpha); for y in 0..TILE_HEIGHT { for x in (0..TILE_WIDTH).step_by(2) { let b0 = vld1q_s16(bg0.get_unchecked(buffer_offset + x) as *const Color16 as *const i16); let b1 = vld1q_s16(bg1.get_unchecked(buffer_offset + x) as *const Color16 as *const i16); let diff = vsubq_s16(b1, b0); let blend = vqrdmlahq_s16(b0, diff, alpha); vst1q_s16(output.get_unchecked_mut(buffer_offset + x) as *mut Color16 as *mut i16, blend); } buffer_offset += SCREEN_WIDTH; } }