From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: basic questions on MPS Date: Fri, 26 Apr 2024 00:56:29 +0530 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="38347"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , emacs-devel , =?UTF-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 25 21:27:30 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 1s04kk-0009ii-Cd for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Apr 2024 21:27:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s04k7-000127-Pc; Thu, 25 Apr 2024 15:26:51 -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 1s04k4-0000tv-3E for emacs-devel@gnu.org; Thu, 25 Apr 2024 15:26:49 -0400 Original-Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s04k0-00052Z-H7; Thu, 25 Apr 2024 15:26:47 -0400 Original-Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-5ad2da2196aso872894eaf.2; Thu, 25 Apr 2024 12:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714073201; x=1714678001; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=398p7QBPHCwLVRekFmHrRhkzZKcrySpMpbsz9T2QYjc=; b=nsjZDmlnE1bWlbToiMaeMy/WLpdRsQ2RyW0pMFHG0hA7+RHXtFDA8D5iXEYHVjq1Kp umTCQJdbH17uJ1m76/SbIKFyCCW+Q8qb6HcC0iQL0+M54okbdqBliQoWxJIK+YR1/Eol teb+KhGFBP+FD9Z7RGej3gS6W8hPHa2vhTqUE31tu0gtNBresF2xasLhwF7FoRCsUYe2 S3BbSAD9guuHXnahQ9FR6KT1IFVA8hswSADmUHxkWSLBqON+enAzLAaHjEtnA2HcitYw 571Qpl3OA4DUix79jKP8Oo39gEVHv0LN7U+GUWUfBnquIbZ4t7dU7IWSyFeKTX1CrnKe mA6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714073201; x=1714678001; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=398p7QBPHCwLVRekFmHrRhkzZKcrySpMpbsz9T2QYjc=; b=b1duUyKJhTznoc1nBZdlhd8l+uu4PVeNZryycS0TG8PqfrtQBCdA6HTHOeZvp9XTZR 0Hz+jxOGwj+8a0MNO2/n4vIL2o2zGLcSUr3paXnTaEnG+2qWoibs2hIQspN6rhXgLJA3 rdELyhwj06F/IJK3m4dPBLWFPcFqqQMAuS2Ydby4aMLixf4E//f/yjEzL4ccv4dN4Ose 3S9Dse33s0+xLJfEOGC717voHE4SsH9MKDlN8M4JlppH4bTtNQQEwr5xSWmiFrQhzuTe vZAExF6d5WhLijgrVKpODAJlsfU8kepBDiMInyWD369scarNgK0VDj7z0a/sn/aFbT9u fAqA== X-Forwarded-Encrypted: i=1; AJvYcCWlJrRJDqx3MQv69am463rIjOzi7LdGaPtNjWoVDs/aFJC6/xMgYSTFdo1NYvWevCraz4S+zjMGhVo0im7OCrFgWW/e X-Gm-Message-State: AOJu0YypHdoqGzLWvktbfzyAG4PDvZ48eG3bt4ihdA27upRu7aP6jeLA W352G79D3vOpQ6Vu10SKBQKScwblIHV6Xofwm1dx79Mkgth5ZsxhLwRb2hx2jfPVg247lIFXT+g KO+9IIySPSfY7Nbly4BjtsDS0gGc= X-Google-Smtp-Source: AGHT+IG/kezBxaFossMpDJS7chWDpykKCPVGy78kLysA/ycjfxM/OvanFcsPZ05dZinSy4TWagk9UxZXpUn3d+EuTB4= X-Received: by 2002:a05:6358:b588:b0:17b:602f:24c6 with SMTP id wa8-20020a056358b58800b0017b602f24c6mr528832rwc.24.1714073200808; Thu, 25 Apr 2024 12:26:40 -0700 (PDT) In-Reply-To: <87sez9fhzk.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c36; envelope-from=vibhavp@gmail.com; helo=mail-oo1-xc36.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:318099 Archived-At: 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. 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. 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. Vibhav --- Vibhav Pant vibhavp@gmail.com GPG: 7ED1 D48C 513C A024 BE3A 785F E3FB 28CB 6AB5 9598