[swift-lldb-dev] REPL questions

Gage Morgan gagemorgan at outlook.com
Mon Dec 7 20:19:52 CST 2015


That was what I was looking for. Just one more question: For any project, how is a C to Swift function binding created? I'd like to know how to import C functions to Swift. Once I can do this successfully, I'll be all set.

Sent from Outlook




On Sun, Dec 6, 2015 at 10:39 PM -0800, "Todd Fiala" <todd.fiala at gmail.com> wrote:





Hi Gage,

The REPL does let you import Swift modules.  If you wanted to make or find
a GTK binding, load it into the REPL, and drive that via the REPL, you
certainly could do that.  Using the REPL to do this would allow you to
explore the binding at runtime, as many REPL-based languages afford.  Is
that the kind of thing you're after?

The last comment makes me think you may be asking more about a graphical
REPL, though.  Xcode has Playgrounds, but that doesn't exist in Open Source
Swift.  I don't see what would stop somebody from trying to write something
similar against GTK or any other GUI library.

Hope that helps!

-Todd

On Sun, Dec 6, 2015 at 6:12 PM, Gage Morgan <gagemorgan at outlook.com> wrote:

> > The Swift-specific parts (i.e. any files not in the llvm.org LLDB
> source base) are > available according to the license as specified at
> swift.org. I would direct you to > those licenses to see if they are
> compatible with your desired usage.
>
> Let me rephrase that, I think that was a response to asking what Apple
> says you can or cannot do with REPL. I meant "Has Apple stated possible
> uses for REPL other than from the CLI-only interface?"
>
> I'm looking to develop GUIs with it, but am unsure how.
>
> Thanks,
> --MGage--
>
> Sent from Outlook <http://aka.ms/Ox5hz3>
>
> _____________________________
> From: Todd Fiala via swift-lldb-dev <swift-lldb-dev at swift.org>
> Sent: Saturday, December 5, 2015 7:33 PM
> Subject: [swift-lldb-dev] REPL questions
> To: <swift-lldb-dev at swift.org>
>
>
>
> Hi all,
>
> Thanks for the questions on the REPL.
>
> With respect to incorporating a REPL into another program, the text-based
> Swift REPL is available in and implemented via LLDB.  As Swift LLDB is
> implemented on top of LLDB, there are two projects involved with regards to
> the source.  The source code for the core of LLDB (as available via
> llvm.org) is available according to the terms of the license as spelled
> out at llvm.org.  The Swift-specific parts (i.e. any files not in the
> llvm.org LLDB source base) are available according to the license as
> specified at swift.org.  I would direct you to those licenses to see if
> they are compatible with your desired usage.
>
> There are at least a few apps that incorporate LLDB into their IDEs,
> either via the SB API (the LLDB C++-based API), via the GDB Remote
> protocol, and via the GDB mi protocol (via lldb-mi).  It is definitely
> possible to go the route of setting up an app that communicates with LLDB
> to get a REPL experience that way.
>
> I'll be able to comment more directly on questions this upcoming week.
> --
> -Todd
>
>
>


--
-Todd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-lldb-dev/attachments/20151208/2c57c7fb/attachment.html>


More information about the swift-lldb-dev mailing list