From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: basic questions on MPS Date: Fri, 26 Apr 2024 08:42:20 +0200 Message-ID: References: <87sez9fhzk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , Andrea Corallo , emacs-devel To: Vibhav Pant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 26 08:43:10 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s0FIc-0008kZ-L9 for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Apr 2024 08:43:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0FIC-0006mt-9G; Fri, 26 Apr 2024 02:42:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0FHv-0006kg-AR for emacs-devel@gnu.org; Fri, 26 Apr 2024 02:42:27 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0FHt-0004Ap-3w; Fri, 26 Apr 2024 02:42:26 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-56e48d0a632so2580457a12.2; Thu, 25 Apr 2024 23:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714113742; x=1714718542; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J2rSpZgF2w/cxzQjqMSBAO0JjrwQPaL567QJHr05WiQ=; b=VH3EY/+PCE+CdBqLPiGil09oocreGCh8A5C4AVaRCoIlvkpM1tHQ85dTLFndbo/2dT mQtN2oqIkG9EonqikXsp4HR1pJjEt15lQe+esinBGNHHl/KulPkHA4N81FJGqJ7pFoGI UukvQpS0wP9jwci/osPsxVZBZ6E71Zn89ozkuoEUtcMNga5FL3fKkXTJJxAD0IP2mM4e 6oBstJHCmZEBF3RyTnRLsHhZEpZKbSqykgM9jbsg2tnpeKeiEg2c5PKWzyOqdq5xMTL/ sev4LvgFYGCAMmqGW2NX4ppBt50Gdv8or60Oy6rPCw5grfrdzGid1Dp1kHGzDHGBLtRq FS3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714113742; x=1714718542; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=J2rSpZgF2w/cxzQjqMSBAO0JjrwQPaL567QJHr05WiQ=; b=muCMyQLP2dPQChnoS6179DHXziDQZEnEodl7XhCwTT7iuxXyAuJk2DOmqENaFW+AOW P0GEVbjsNDb9Y5A5nY/aSFZ+ScXpNZbZxD45F37yvCvcWf7OflLWSalmWcSErKPQyFbr vre23pzNgBx91WiLCiOqRmwLsuryToPTo+z+sY49NTQ/wnmfRT152zIh5BJTO8VCoyiV loHn3uCDYQ7LoU00L8Az2/c+cg49nxpXY3T50clyETNK7nlObqLzgfxOOTvp5yhHodNm Gw33Kigzb8TjEDs0Uwqp3qWCeQT6ek02PaMIReIHpIulVJS4UJgKA/e7cU4h1JsemB7N 3idA== X-Forwarded-Encrypted: i=1; AJvYcCUn/LLOSy7EdfaUErhGXjbbo3+CuCvpOHG2VhIsegPUum0i5xUH8q6MGxhr+1XoGRdHTbmzHWtJCYAgIKxFCjxcPnEMaZHGSiboaGfoh7gdeHoQAW8h X-Gm-Message-State: AOJu0YxH4Y0NTWJxPY/hbZxPc7dmG2p3K5H6r5XW7+gAg04g+/IqB/aF W9+13QTWucYBheqagX4+Be7aNHOJjbqDyGblBB2XFxPrmEWSpmT5QaCVRw== X-Google-Smtp-Source: AGHT+IF3QlQ/rU19WTgxZJB+4LaswNICHwkR5wEuzqCBUbbox5uL5c9tPYuSpCPUq+xcjO8JTZgaYQ== X-Received: by 2002:a17:907:86a9:b0:a52:3316:bc29 with SMTP id qa41-20020a17090786a900b00a523316bc29mr1902381ejc.3.1714113742248; Thu, 25 Apr 2024 23:42:22 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a4eb.dip0.t-ipconnect.de. [79.227.164.235]) by smtp.gmail.com with ESMTPSA id i8-20020a170906264800b00a52433f0907sm10281504ejc.37.2024.04.25.23.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 23:42:21 -0700 (PDT) In-Reply-To: (Vibhav Pant's message of "Fri, 26 Apr 2024 00:56:29 +0530") Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318105 Archived-At: Vibhav Pant writes: > On Thu, Apr 25, 2024 at 11:23=E2=80=AFPM Helmut Eller wrote: >> >> I'd also have some MPS related questions. Just curiosity. >> >> 1) Does somebody have experience with this MMTK [https://www.mmtk.io/]? >> How does it compare to MPS? >> > > From my understanding, MMTk is a *framework* for writing a memory > manager + an API for allocating and working with allocated memory. A > language runtime being "ported" to MMTk seems to involve these two > things: > * The language's VM and memory management model needs to be thoroughly > known to MMTk. It should know how objects addresses in the language > look like, where and how their metadata gets stored and loaded, how > copy semantics are implemented, etc > (https://docs.rs/mmtk/latest/mmtk/vm/trait.VMBinding.html). > * The language runtime calls *into* MMTk's language-agnostic memory > management API for allocating memory, setting metadata, attach > finalizers, etc. Even stuff like pointer arithmetic needs to be done > through MMTk, as the language runtime code cannot make any assumptions > about the memory model. That sounds expensive, to say the least, both performance-wise and implementation effort involved to make Emacs use the MMTk API. If it could technically be done (Rust <-> C?). > Once that's done, a program can choose which GC algorithm it would > like to use during runtime > (https://docs.mmtk.io/api/mmtk/util/options/enum.PlanSelector.html). > MMTk/mmtk-core by itself does not "support" any languages, as one goal > of the project seems to be to provide a way to write garbage > collection algorithms for an abstract virtual machine. Thanks for the overview! > Perhaps not the same thing, but a similar idea is LLVM's support for > GC (https://llvm.org/docs/GarbageCollection.html), as LLVM IR code > generated by a compiler in such a case uses special instrinsics for > fiddling with pointer metadata, declaring write and load barriers, > etc, with the basic idea being that LLVM knows everything about > managed objects in the language runtime. You can then write a garbage > collector as an LLVM plugin, which theoretically can be loaded at > runtime. Yes, I've seen that too. Very interesting, but I guess it's out of reach for GNU.