sci

Rod Schmidt 2024-10-29T18:11:34.375139Z

Anybody have success building libsci for iOS? I haven’t. It would be nice if there were some prebuilt binaries. Maybe someone could send me one?

phronmophobic 2024-10-29T18:12:57.319829Z

I don't think iOS allows you to load shared libraries. I think you have to build a static library.

Rod Schmidt 2024-10-29T18:14:03.347789Z

Yes. That’s what I want. You can have a prebuilt static library.

phronmophobic 2024-10-29T18:14:32.713389Z

I've done some work with sci on iOS, https://github.com/phronmophobic/grease. The current repo is in flux.

Rod Schmidt 2024-10-29T18:14:59.625349Z

Yes, I’ve been looking at that. Haven’t had any luck following the instructions.

phronmophobic 2024-10-29T18:16:13.811789Z

There's an older commit where I could build for iOS on github, https://github.com/phronmophobic/grease/actions/runs/9844678503

phronmophobic 2024-10-29T18:16:25.726019Z

Which was using this commit, https://github.com/phronmophobic/grease/commit/dc3890f914f4f9291f97a1f8d9ba6bbc0b4bbda6

phronmophobic 2024-10-29T18:17:36.444239Z

The current build is a bit complicated and not for the faint of heart. Do you have a description of the goal you have in mind?

phronmophobic 2024-10-29T18:19:54.573129Z

> Yes, I’ve been looking at that. Haven’t had any luck following the instructions. The Readme is currently out of date.

Rod Schmidt 2024-10-29T18:20:03.635529Z

I just want to link the libsci library into a normal Swift app and use it to embed clojure.

phronmophobic 2024-10-29T18:20:53.849349Z

What will the clojure code do?

Rod Schmidt 2024-10-29T18:21:32.078509Z

Just some domain logic. Pure functions. No need to call into the swift app or call anything having to do with iOS or Swift.

phronmophobic 2024-10-29T18:22:14.362229Z

Ah ok. Hooking up the sci environment to the outside world is a little more involved.

phronmophobic 2024-10-29T18:25:31.521219Z

Do you have an environment that can build for iOS?

Rod Schmidt 2024-10-29T18:28:05.661589Z

Yes. I’m an iOS developer.

phronmophobic 2024-10-29T18:30:59.997299Z

Following the workflow at https://github.com/phronmophobic/grease/blob/dc3890f914f4f9291f97a1f8d9ba6bbc0b4bbda6/.github/workflows/mobiletest.yml should get you pretty close.

phronmophobic 2024-10-29T18:33:44.782029Z

Ah, I see that doesn't compile sci in that example. I've since made some updates to support a more complicated build, but I'm not sure if any of them are required for a basic sci build.

phronmophobic 2024-10-29T18:34:52.473989Z

The exposed functions are defined at https://github.com/phronmophobic/grease/blob/dc3890f914f4f9291f97a1f8d9ba6bbc0b4bbda6/src/com/phronemophobic/grease.clj#L65. The native image build will spit out a header file that you can use from swift.

Rod Schmidt 2024-10-29T20:03:57.887099Z

Thanks