unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Mixed Languages Programming
@ 2021-03-10 23:23 Yasuaki Kudo
  2021-03-10 23:26 ` Léo Le Bouter
  2021-03-11  0:00 ` divoplade
  0 siblings, 2 replies; 7+ messages in thread
From: Yasuaki Kudo @ 2021-03-10 23:23 UTC (permalink / raw)
  To: help-guix

Hello!

Does anyone have an insight into mixing different programming language?  Say Visual Basic, Java, Racket, Haskell, etc

I thought one way would be to convert each program into web services but I wonder if there is a more intimate way - I heard of something called Corba long time ago and there is Microsoft's .NET and Java JVM?

Is this a topic that is particularly interesting to the Guix community because of interoperability, mixing packages, etc? 😄

Cheers,
Yasu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-10 23:23 Mixed Languages Programming Yasuaki Kudo
@ 2021-03-10 23:26 ` Léo Le Bouter
  2021-03-13 23:59   ` raingloom
  2021-03-11  0:00 ` divoplade
  1 sibling, 1 reply; 7+ messages in thread
From: Léo Le Bouter @ 2021-03-10 23:26 UTC (permalink / raw)
  To: Yasuaki Kudo, help-guix

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Thu, 2021-03-11 at 08:23 +0900, Yasuaki Kudo wrote:
> Hello!

Hello!

I think you can use JSON-RPC libraries as modern alternatives to that.
Also gRPC. The "micro-service" paradigm.

> Is this a topic that is particularly interesting to the Guix
> community because of interoperability, mixing packages, etc? 😄

I don't think so, not in particular.

> Cheers,
> Yasu

Léo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-10 23:23 Mixed Languages Programming Yasuaki Kudo
  2021-03-10 23:26 ` Léo Le Bouter
@ 2021-03-11  0:00 ` divoplade
  2021-03-11 13:35   ` Yasuaki Kudo
  1 sibling, 1 reply; 7+ messages in thread
From: divoplade @ 2021-03-11  0:00 UTC (permalink / raw)
  To: Yasuaki Kudo, help-guix

Hello,

Le jeudi 11 mars 2021 à 08:23 +0900, Yasuaki Kudo a écrit :
> Does anyone have an insight into mixing different programming
> language?  Say Visual Basic, Java, Racket, Haskell, etc

I am aware of 3 different kinds of approaches:
- writing programs in different languages, with one programming
language occupying a whole process (so, web services as you say, or
scripts, or an org-mode file, for instance);
- extending a "managed" programming language with C or C++ code; in
theory it could be possible to do the same for two different
programming languages and link both C interfaces together; this is what
SWIG (http://swig.org/) does, but using some language in another
language that way feels a lot like coding in C;
- using a common virtual machine as the target for the compilation of
many different languages (like elisp and scheme for guile).



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-11  0:00 ` divoplade
@ 2021-03-11 13:35   ` Yasuaki Kudo
  0 siblings, 0 replies; 7+ messages in thread
From: Yasuaki Kudo @ 2021-03-11 13:35 UTC (permalink / raw)
  To: divoplade; +Cc: help-guix

Thank you both,

It feels like using the web API as the interface between the languages would be the simplest.

Guix might come in really handy if the web services are all running on the same Guix machine in which they can share the resources of the OS such as the file system.

Then, using RAM-based or the real disk, different processes compiled in different languages can efficiently exchange data!

That's something that Guix and Nix can do more easily than using Docker web services on other OSes? 😄

Yasu




> On Mar 11, 2021, at 09:00, divoplade <d@divoplade.fr> wrote:
> 
> Hello,
> 
>> Le jeudi 11 mars 2021 à 08:23 +0900, Yasuaki Kudo a écrit :
>> Does anyone have an insight into mixing different programming
>> language?  Say Visual Basic, Java, Racket, Haskell, etc
> 
> I am aware of 3 different kinds of approaches:
> - writing programs in different languages, with one programming
> language occupying a whole process (so, web services as you say, or
> scripts, or an org-mode file, for instance);
> - extending a "managed" programming language with C or C++ code; in
> theory it could be possible to do the same for two different
> programming languages and link both C interfaces together; this is what
> SWIG (http://swig.org/) does, but using some language in another
> language that way feels a lot like coding in C;
> - using a common virtual machine as the target for the compilation of
> many different languages (like elisp and scheme for guile).
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-10 23:26 ` Léo Le Bouter
@ 2021-03-13 23:59   ` raingloom
  2021-03-18 12:34     ` Yasuaki Kudo
  0 siblings, 1 reply; 7+ messages in thread
From: raingloom @ 2021-03-13 23:59 UTC (permalink / raw)
  To: Léo Le Bouter; +Cc: help-guix

On Thu, 11 Mar 2021 00:26:41 +0100
Léo Le Bouter <lle-bout@zaclys.net> wrote:

> On Thu, 2021-03-11 at 08:23 +0900, Yasuaki Kudo wrote:
> > Hello!  
> 
> Hello!
> 
> I think you can use JSON-RPC libraries as modern alternatives to that.
> Also gRPC. The "micro-service" paradigm.
> 
> > Is this a topic that is particularly interesting to the Guix
> > community because of interoperability, mixing packages, etc? 😄  
> 
> I don't think so, not in particular.
> 
> > Cheers,
> > Yasu  
> 
> Léo

There is an interesting Nix based project that has some actual good use
cases for a common intermediate representation:
https://publish.illinois.edu/allvm-project/

Chris Webber's talk on Spritely also had some good ideas for using OCAP
in Guix to enhance security by a whole lot.
https://fosdem.org/2021/schedule/event/spritelygoblins/
And that is basically just cross-language remote procedure calls.

Another interesting possibility is to run everything on WASM without an
MMU. See the classic The Birth and Death of Javascript talk.
https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
Of course that one is pre-Spectre/Meltdown, so take it with a grain of
salt.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-13 23:59   ` raingloom
@ 2021-03-18 12:34     ` Yasuaki Kudo
  2021-03-19  1:20       ` raingloom
  0 siblings, 1 reply; 7+ messages in thread
From: Yasuaki Kudo @ 2021-03-18 12:34 UTC (permalink / raw)
  To: raingloom; +Cc: help-guix

I have just thought about dynamic "Rosetta Code" - some software that generates simple code for the target language, compiles it and tests the result.

It might be useful to learn a new language.

For example, in PowerShell, there is some awkward syntax for an array of array wherein :

(,(1,2))

If the preceding comma is omitted, it will not be treated as an array of array.

My idea is to write some simple code in the language one is familiar and let the program translate it to some other language, while using Guix to summon the necessary compiler for the target language 😄
 






> On Mar 14, 2021, at 10:30, raingloom <raingloom@riseup.net> wrote:
> 
> On Thu, 11 Mar 2021 00:26:41 +0100
> Léo Le Bouter <lle-bout@zaclys.net> wrote:
> 
>>> On Thu, 2021-03-11 at 08:23 +0900, Yasuaki Kudo wrote:
>>> Hello!  
>> 
>> Hello!
>> 
>> I think you can use JSON-RPC libraries as modern alternatives to that.
>> Also gRPC. The "micro-service" paradigm.
>> 
>>> Is this a topic that is particularly interesting to the Guix
>>> community because of interoperability, mixing packages, etc? 😄  
>> 
>> I don't think so, not in particular.
>> 
>>> Cheers,
>>> Yasu  
>> 
>> Léo
> 
> There is an interesting Nix based project that has some actual good use
> cases for a common intermediate representation:
> https://publish.illinois.edu/allvm-project/
> 
> Chris Webber's talk on Spritely also had some good ideas for using OCAP
> in Guix to enhance security by a whole lot.
> https://fosdem.org/2021/schedule/event/spritelygoblins/
> And that is basically just cross-language remote procedure calls.
> 
> Another interesting possibility is to run everything on WASM without an
> MMU. See the classic The Birth and Death of Javascript talk.
> https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
> Of course that one is pre-Spectre/Meltdown, so take it with a grain of
> salt.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mixed Languages Programming
  2021-03-18 12:34     ` Yasuaki Kudo
@ 2021-03-19  1:20       ` raingloom
  0 siblings, 0 replies; 7+ messages in thread
From: raingloom @ 2021-03-19  1:20 UTC (permalink / raw)
  To: help-guix

On Thu, 18 Mar 2021 21:34:40 +0900
Yasuaki Kudo <yasu@yasuaki.com> wrote:

> > On Mar 14, 2021, at 10:30, raingloom <raingloom@riseup.net> wrote:
> > 
> > On Thu, 11 Mar 2021 00:26:41 +0100
> > Léo Le Bouter <lle-bout@zaclys.net> wrote:
> >   
> >>> On Thu, 2021-03-11 at 08:23 +0900, Yasuaki Kudo wrote:
> >>> Hello!    
> >> 
> >> Hello!
> >> 
> >> I think you can use JSON-RPC libraries as modern alternatives to
> >> that. Also gRPC. The "micro-service" paradigm.
> >>   
> >>> Is this a topic that is particularly interesting to the Guix
> >>> community because of interoperability, mixing packages, etc? 😄
> >>>  
> >> 
> >> I don't think so, not in particular.
> >>   
> >>> Cheers,
> >>> Yasu    
> >> 
> >> Léo  
> > 
> > There is an interesting Nix based project that has some actual good
> > use cases for a common intermediate representation:
> > https://publish.illinois.edu/allvm-project/
> > 
> > Chris Webber's talk on Spritely also had some good ideas for using
> > OCAP in Guix to enhance security by a whole lot.
> > https://fosdem.org/2021/schedule/event/spritelygoblins/
> > And that is basically just cross-language remote procedure calls.
> > 
> > Another interesting possibility is to run everything on WASM
> > without an MMU. See the classic The Birth and Death of Javascript
> > talk.
> > https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
> > Of course that one is pre-Spectre/Meltdown, so take it with a grain
> > of salt.  

> I have just thought about dynamic "Rosetta Code" - some software that
> generates simple code for the target language, compiles it and tests
> the result.
> 
> It might be useful to learn a new language.
> 
> For example, in PowerShell, there is some awkward syntax for an array
> of array wherein :
> 
> (,(1,2))
> 
> If the preceding comma is omitted, it will not be treated as an array
> of array.
> 
> My idea is to write some simple code in the language one is familiar
> and let the program translate it to some other language, while using
> Guix to summon the necessary compiler for the target language 😄 

The Rosetta Code website already exists for this use case:
https://rosettacode.org/

But this is not really relevant to Guix.

ps.: I took the liberty of rearranging your mail into a bottom-reply.
Top replying is generally not recommended on mailing lists.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-19  1:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 23:23 Mixed Languages Programming Yasuaki Kudo
2021-03-10 23:26 ` Léo Le Bouter
2021-03-13 23:59   ` raingloom
2021-03-18 12:34     ` Yasuaki Kudo
2021-03-19  1:20       ` raingloom
2021-03-11  0:00 ` divoplade
2021-03-11 13:35   ` Yasuaki Kudo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).