Dive into the world of programming languages used for app development.

All subtopics
Posts under Programming Languages topic

Post

Replies

Boosts

Views

Activity

Data Disappeared
Hi, writing a database app for storing equipment details. Spent the day doing minor changes and tidying with many backups made, and always re-building to check its all working. Everything ok but then next build looses all data, what's the best thing to check to see if the data is still there, any help would be fantastic.
1
0
1.1k
1w
Apple Silicon calling printf
What is the proper way to pass arguments to printf with multiple variables using ARM64 Apple Silicon? Example: fOutputStr: .asciz "Element[%d] = %d\n" // formated output string for an output of: Element[4] = 9 This code (see below) works on Raspberry Pi 5, on my Mac Studio, I am getting this output, Element[9] = 1871655168 What do I need to do to use printf from an assembly language call with multiple variables? I am using the following code. ` .align 2 // memory alignment model for 64-bit ARMc #if defined(APPLE) .global _main // Provide program starting address to linker Mac OS _main: #else .global main // Raspian and Linux main: #endif // stack frame work setup START stp x29, x30, [sp, -16]! str x20, [sp, -16]! mov x29, sp // stack frame work setup END // setup printf call #if defined(APPLE) adrp x0, fOutputStr@PAGE add x0, x0, fOutputStr@PAGEOFF #else ldr x0, =fOutputStr #endif mov w1, #4 mov w2, #9 print_brk: #if defined(APPLE) stp X0, X1, [SP, #-16]! stp X2, X3, [SP, #-16]! bl _printf ldp X2, X3, [SP], #16 ldp X0, X1, [SP], #16 #else bl printf #endif done: // closing stack frame work ldr x20, [sp],16 ldp x29, x30, [sp],16 // exit mov w0, wzr ret .data .align 4 // intArrayPtr: .word 3,7,5,2,4,8 // word, each value is offset by 4 fOutputStr: .asciz "Element[%d] = %d\n" // formated output string
6
1
649
5d
Attached macro loses generated source file
I’m seeing what looks like a compiler / macro-expansion / build-pipeline issue. Environment: Xcode 26.4 RC (17E192, latest); I believe it is also reproducible on earlier versions. github source code I reduced this to a very small macOS/iOS app plus a local macro package. The app logic is trivial, but app exits immediately on launch with code 138 Important observations: If I inline everything into a single file, the problem disappears. I also see an error like this during investigation: The file path does not exist on the file system: /var/folders/.../swift-generated-sources/@__swiftmacro_18MacroFeedbackRepro20MountActivationState17PreservedRawValuefMm_.swift That makes me suspect this is not an application logic issue, but something in macro expansion / generated source handling / compiler pipeline.
0
0
142
21h
Why is the Documentation full of Conundrums?
I'm trying to learn and focus on the task and your examples keep having hidden conundrums in them. Here is an example that got me snagged for hours last night going, Well what the F do they want me to name it? What is it you want me to learn here? Because you pose a giant riddle of name something that you should be given a name for... My friend said to me that this is a common thing you will have to do and they were right however... What are you asking me to do? Get stuck on the variable naming problem where I'm going... Yeah those are math terms from 20+ years ago and I have no idea how to classify those terms... Are you asking me that? No. So why is that in the problem. These conundrums mixed in with legitimate problems honestly make me not want to learn Swift at all.
2
0
137
14m
Data Disappeared
Hi, writing a database app for storing equipment details. Spent the day doing minor changes and tidying with many backups made, and always re-building to check its all working. Everything ok but then next build looses all data, what's the best thing to check to see if the data is still there, any help would be fantastic.
Replies
1
Boosts
0
Views
1.1k
Activity
1w
Apple Silicon calling printf
What is the proper way to pass arguments to printf with multiple variables using ARM64 Apple Silicon? Example: fOutputStr: .asciz "Element[%d] = %d\n" // formated output string for an output of: Element[4] = 9 This code (see below) works on Raspberry Pi 5, on my Mac Studio, I am getting this output, Element[9] = 1871655168 What do I need to do to use printf from an assembly language call with multiple variables? I am using the following code. ` .align 2 // memory alignment model for 64-bit ARMc #if defined(APPLE) .global _main // Provide program starting address to linker Mac OS _main: #else .global main // Raspian and Linux main: #endif // stack frame work setup START stp x29, x30, [sp, -16]! str x20, [sp, -16]! mov x29, sp // stack frame work setup END // setup printf call #if defined(APPLE) adrp x0, fOutputStr@PAGE add x0, x0, fOutputStr@PAGEOFF #else ldr x0, =fOutputStr #endif mov w1, #4 mov w2, #9 print_brk: #if defined(APPLE) stp X0, X1, [SP, #-16]! stp X2, X3, [SP, #-16]! bl _printf ldp X2, X3, [SP], #16 ldp X0, X1, [SP], #16 #else bl printf #endif done: // closing stack frame work ldr x20, [sp],16 ldp x29, x30, [sp],16 // exit mov w0, wzr ret .data .align 4 // intArrayPtr: .word 3,7,5,2,4,8 // word, each value is offset by 4 fOutputStr: .asciz "Element[%d] = %d\n" // formated output string
Replies
6
Boosts
1
Views
649
Activity
5d
Attached macro loses generated source file
I’m seeing what looks like a compiler / macro-expansion / build-pipeline issue. Environment: Xcode 26.4 RC (17E192, latest); I believe it is also reproducible on earlier versions. github source code I reduced this to a very small macOS/iOS app plus a local macro package. The app logic is trivial, but app exits immediately on launch with code 138 Important observations: If I inline everything into a single file, the problem disappears. I also see an error like this during investigation: The file path does not exist on the file system: /var/folders/.../swift-generated-sources/@__swiftmacro_18MacroFeedbackRepro20MountActivationState17PreservedRawValuefMm_.swift That makes me suspect this is not an application logic issue, but something in macro expansion / generated source handling / compiler pipeline.
Replies
0
Boosts
0
Views
142
Activity
21h
Why is the Documentation full of Conundrums?
I'm trying to learn and focus on the task and your examples keep having hidden conundrums in them. Here is an example that got me snagged for hours last night going, Well what the F do they want me to name it? What is it you want me to learn here? Because you pose a giant riddle of name something that you should be given a name for... My friend said to me that this is a common thing you will have to do and they were right however... What are you asking me to do? Get stuck on the variable naming problem where I'm going... Yeah those are math terms from 20+ years ago and I have no idea how to classify those terms... Are you asking me that? No. So why is that in the problem. These conundrums mixed in with legitimate problems honestly make me not want to learn Swift at all.
Replies
2
Boosts
0
Views
137
Activity
14m