Skip to content
0:00 / 0:00

#perl6#raku#inline

YAPC::Europe 2014 Day3 Lightningtalk 06

yapceu

330 subscribers • 2 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • A classic. People kept recommending it from 2018 to 2025.

Intermediate. Assumes working knowledge.

326 views12 years ago2 recommendations

Programming languagesLanguage design and type systems

A lightning talk demonstrating seamless multi-language interoperability and inline code execution in Perl 6.

The uploader added no description.

Why it's here

2 people recommend this

What people say. Recommended as a mind-expanding demonstration of seamless multi-language integration.

u/raiphin r/ProgrammingLanguages • Recommends

On “How C++ supports the whole C's library and how I could do the same if I created a language?”

You might find it useful to consider the Raku experience of attempting something somewhat similar to, but less ambitious than, what you describe. \---- Raku supports libraries written in other PLs. It has: * NativeCall (Raku doc page), a FFI for portable loading and HLL use of C libraries. As mentioned on that page, NativeCall includes primitive experimental support for C++. * The Inlines (Raku module listing), which are HLL foreign PL adaptors. They allow Raku devs to import foreign PLs' libraries and then write Raku code that uses those libraries' functions as if they were Raku ones. \---- Aiui, in principle, Raku code could do things like instantiating an object that's an instance of…

u/raiphin r/ProgrammingLanguages • Recommends

On “What would be wrong with a multi-syntax programming language?”

You might want to check out What are examples of language syntaxes which do a GOOD job embedding (an)other language(s) in a host language?, a thread written in this sub a while back. The usual suspects get mentioned (Haskell's quasiquoting, Racket) but also some others. I wrote one of the highest voted top level comments. It was about what might seem like a minor cosmetic thing (*seamless weaving* of multiple syntaxes) but what should be of interest today is the underlying multi language technology that Raku and its sibling nqp ("not quite paradise") are both built on and make available for any devs using them. That multi language tech began with a comment I quoted in a non-authoritative b…

u/raiphin r/ProgrammingLanguages • Recommends

On “Video resources to help learn”

This 4 minute video should change open minded folks' thinking about what is possible. When this video was produced (2018), the languages ecosystem underlying the builder it demonstrates wasn't mature enough to change the rules of the game. (Moreover, in the end, the rules of the programming game, and thus the programming of programming languages game, is all just nomics.) But I think it's well worth a watch to: * **See what's possible for PL lovers** The language developed in those 4 minutes is just the creamy filling of a Twinkie. But if you imagine a Twinkie as a form of food, and let your imagination soar rather than cynicism overrule your heart, you should begin to see *possibiliti…

u/raiphin r/ProgrammingLanguages • Recommends

On “How C++ supports the whole C's library and how I could do the same if I created a language?”

> After reading the whole thing... If you can see and hear, I recommend you watch the 3 minute "`hello world` with a twist" video if you haven't already. It viscerally demonstrates that **it's all about the joy**. > So probably I won't do it at all. If you think it will give you joy merely to be on the journey, without any burning need to get to any particular destination, then, imo, go for it. > Maybe in this case the best thing I could do is ... ... start. :) I got the following from a book about James Clerk Maxwell. Before he died in 1879, he had suggested he thought it unlikely that anybody would ever be able to measure things on earth with sufficient precision to measure the sp…

u/raiphin r/ProgrammingLanguages • Recommends

On “Metalanguages or languages with extensible syntax”

While my comment to which this is a reply distils what I think lay behind the names Perl, Perl 6, and Raku, I think *another* critically important and relevant technical revolution that has emerged -- as a *complement* to the original Kathadin-like concept -- is the Inline architecture. This latter is a powerful example of the way everything will be connected if you just think that way. The original *Inline* phenomena emerged in the Perl world, driven by the inspiring archetypal "we are all one" thinker Ingy döt Net. The idea was that one could inline code written in other PLs directly into Perl. Then niner, who wrote Inline-Python for Perl, decided to jump into the Raku world. Here's [th…

u/raiphin r/ProgrammingLanguages • Recommends

On “The Single Open Intermediate Language Initiative”

You're right that it's not easy. But it *is* possible. One of the bigger challenges that led to P6's 15 year gestation was addressing what became an implicit design goal of practical, performant, smooth interop between disparate programming languages, whether that be C, C++, Python, Perl 5, Perl 6, Ruby, Lua, Haskell, etc. This emerged from the design goal of being able to combine P5 and P6 with no constraint on how different they were from each other. This entailed designing things like language agnostic metaprogramming (bootstrapped from a "type" that "knows" little statically beyond that it has a meta-type that knows how it works, sort of like a concrete notion of "kind", and little dyn…

u/Unlikely-Bed-1133in r/ProgrammingLanguages • Recommends

On “Blombly v1.30.0 - Namespaces (perhaps a bit weird but I think very practical)”

I think it's funny that the syntax is similar *and* both languages allow such extreme modifications; maybe the concepts are somehow related conceptually? E.g., the whole namespace implementation in Blombly is the following monster of a macro in the standard library instead of being hard-coded in the VM. (Showing the macro in case of interest where @ match substituted code segments @@ are substituted only after one substitution, etc, keywords starting with ! are preprocessor directives. Also note that the standard library's implementations are included in every program and its useless segments or perhaps all of it are optimized away.) I was a bit surprised that it was possible without affecti…

u/raiphin r/ProgrammingLanguages • Recommends

On “Language interop - beyond FFI”

Oh that's cute. Checkout this wonderful (imo) 3 minute video. I don't want to spoil it by telling you what it is but it soooo relates to what you just said.

u/raiphin r/ProgrammingLanguages • Mentions

On “Eric Lippert: Hundred year mistakes”

> there is still one single runtime over all the construct There's a single runtime over all the constructs *in a given module*. Let's go to an extreme. Consider the case that a module is from a completely different language. There's a 3 minute introduction by Stefan Seifert documenting how work on this began in 2014. Nowadays Raku can use objects from other languages (and can sub-class from at least one other language), marshal exceptions across languages/runtimes, and so on. > Even if you have multiple VM, each VM will have different assumption as to how program is executed Yes. This applies when Raku uses modules written in other languages. It works. Of course more and more work ha…

u/raiphin r/ProgrammingLanguages • Mentions

On “How do you create all the libraries needed for your new programming languages to be useful?”

>The Raku situation is a bit different. There will be an army of people doing all this working, creating bindings etc. Who wants to do *work*?!? It begins with *one person***^(1)** deciding it would be *fun***^(2)**. >Who's going to volunteer in the OP's case, even with a FFI mechanism? (Or my case.) Even if you presume no one will ever join you in developing your PL, why wouldn't implementing an FFI be fun / useful / good for your portfolio/cv? >Unless you can just feed C header files to Raku, and you can just call all the functions, and use all the types, structs, enums, #defines and other macros described in the docs for the that library. You don't need all that complexity. Stefan d…

u/raiphin r/ProgrammingLanguages • Mentions

On “Common standard library for language interop”

You may be interested in the following polyglot combination: * MoarVM, as introduced in this review, is a production backend for NQP. * NQP is a compiler compiler toolkit that targets multiple backends: JVM, JS, and MoarVM. * Rakudo is a Raku compiler that targets NQP. * All use the Artistic License. This combination supports Inlines. Each Inline: * Embeds a compiler process for another programming language into the same process space as MoarVM; * Uses MoarVM's implementation of Raku's FFI to do its particularly nice equivalent of pybind11, julia-cxx, rust-cxx, julia's pycall, etc; * Can optionally uses Rakoon metaprogramming facilities (which are unified in the three layers of the stack)…

u/raiphin r/ProgrammingLanguages • Mentions

On “Are there composable compilers?”

1,000 views. 34 likes. (At least there are no downvotes.) Takes just 4 minutes to watch, plus you get Andrew's chuckle at the end. What's wrong with people!!! :) That made me wonder. I mentioned the *Inline* tech in another comment. There's a fun **3** minute video to go with that. It's the day the genius driving them forward began working on them in 2014. The stuff he's done is incredible, and he's chosen to do it instead of more glamorous academic work after his impressive thesis work on lock-free parallel technology. So let's look at that... 260 views. 6 likes. (Again, at least there are no downvotes.) This is despite, like Andrew, obviously awesome attitude and humour showcasing fabu…

u/raiphin r/ProgrammingLanguages • Mentions

On “[deleted by user]”

Stefan Seifert got to an MVP for interop with his chosen foreign language -- *without* subclassing -- in 2014. (Remarkably, this was the first thing he ever did in Raku, and was done in a few hours, as he revealed in a delightful three minute lightning talk (link to this video) he delivered at the tech conference at which he'd been inspired to try it the previous day.) About 6 weeks later he did a more extensive talk (link primed to his first mention of subclassing) at a later conference. In that talk he demonstrated much smoother interop, including subclassing the foreign language's classes. Fast-forward 7 years and Stefan is the most accomplished of several authors who've written foreign languag…