toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

251
active users

#dylanlang

0 posts0 participants0 posts today

Writing an implementation of the Mustache template system in #DylanLang. Kudos to them for writing tests in YAML and JSON format. It only took about 30 minutes to write a full test suite!

Ran 72 assertions
Ran 194 tests: 41 passed, 122 crashed, and 31 failed

(Now all I have to do is fix all the bugs.)

ps. Do not search for hashtag mustache on Mastodon unless you're up for some gay porn.

#MustacheTemplating
#MustacheTemplates

A new release of the Open Dylan compiler, IDE, and tools is now available for download! It has been a while since we've done a release and this release includes various bug fixes for the compiler, a new multi-line string literal syntax, the Dylan LSP server for emacs and VS Code, and enhancements to Deft, the Open Dylan command-line tool.

See the 2025.1 Release Notes for an overview of what's in this release: opendylan.org/release-notes/20

opendylan.org

opendylan.orgOpen Dylan 2025.1 - Open Dylan
Replied in thread

@UweHalfHand

Possibly this is not at all relevant to your situation but I thought I'd mention the way this is handled in #DylanLang (specifically in Open Dylan) since Dylan is similar to Scheme in many ways. Whether or not you could do similar in the Wile compiler probably depends a lot on implementation details.

"element" is the generic function used for collection accesses. For example, element(s, 0) === s[0]. "element" is defined essentially as

1. call element-range-check(...);
2. call element-no-bounds-check(...);

and Open Dylan provides a macro without-bounds-checks (github.com/dylan-lang/opendyla) that rebinds "element" to "element-no-bounds-check".

github.com/dylan-lang/opendyla

GitHubopendylan/sources/dylan/collection-macros.dylan at 6ea23c96eec5ea6f0b501624c6c768fb5db4a2c8 · dylan-lang/opendylanOpen Dylan compiler and IDE. Contribute to dylan-lang/opendylan development by creating an account on GitHub.
Replied to Vassil Nikolov

@vnikolov @nytpu

We don't always learn every construct in a language by staring at the spec. Frequently (thankfully) it's clear from the argument list, e.g. (map result-type function first-sequence &rest more-sequences) how the function works.

The problem here is that (map nil ...) is completely unintuitive. It's even non-obvious when you see it used in CL code.

This is why #DylanLang has separate functions for map, map-as, and do.

opendylan.org/books/drm/Collec

opendylan.orgCollection Operations — 12. The Built-in Functions — The DRM
Replied in thread

@mdhughes

Your post prodded me to finally read the Rhombus macro paper. (Well, I skipped a lot of the gory details and concentrated on the intro and the comparisons.)

My take, as a #DylanLang lover, is that I don't see a huge advantage in all the flexibility Rhombus provides over what Dylan already has. I tend to use macros sparingly though, in Dylan but even in Common Lisp.

But it seems like a cool advance in the state of the art for non-s-expression macro technology. (Not an expert though.)

@jackdaniel

Replied in thread

@glitzersachen

Personally, I switched to #DylanLang. Although its "locators" library was probably somewhat modeled on Common Lisp pathnames, i'd say it's much better designed.

I've heard some Common Lispers claim they just avoid pathnames completely, but I'm not sure what they do instead.

What's the high-level problem you're trying to solve that has led to this nightmare? Maybe you can avoid it completely?

Replied in thread

@screwtape

This will sound like sacrilege for #CommonLisp but in #DylanLang I no longer use plain symbols as a poor-man's enum. Instead I do this:

define constant $rock = #"rock";
define constant $paper = #"paper";
define constant $scissors = #"scissors";

define constant <tool> = one-of($rock, $paper, $scissors);

and then type things as <tool> where appropriate. Et voilà, I can no longer misspell symbol names without getting a compiler warning. More importantly, neither can clients of my library.

EDIT: fix Dylan bugs, add last sentence.

I made a nice little improvement to the #DylanLang docs recently, by making a small change to the DylanDomain #Sphinx module.

Now wherever I document a class, method, constant, etc, it creates a table of contents entry, making the reference docs much easier to navigate. Seems obvious, right? But it was missing for a long time.

Progress, be it ever so humble.

package.opendylan.org/http/ref is an example where all those entities in the ToC on the right were just missing.

package.opendylan.orgThe HTTP-SERVER library - Dylan Package Documentation
Replied in thread

@amoroso

All the things he talks about macros doing can be done in infix syntax too. #DylanLang for example, since circa 2000. But I will say that _writing_ macros is a lot easier in prefix syntax than infix syntax.

(I have this queued up to read, but have not read it yet: dl.acm.org/doi/10.1145/3622818)

I think that ultimately syntax is a very personal choice. I'm fine with Lisp syntax, but I honestly find Dylan and Python easier to read, precisely _because of_ the variability and no need for lots of parens.

Proceedings of the ACM on Programming LanguagesRhombus: A New Spin on Macros without All the Parentheses | Proceedings of the ACM on Programming Languages Rhombus is a new language that is built on Racket. It offers the same kind of language extensibility as Racket itself, but using traditional (infix) notation. Although Rhombus is far from the first language to support Lisp-style macros without ...
Replied in thread

@abcdw I'd say if you don't really care about parsing tech, just skip that part of whatever book you choose.

I'm going through craftinginterpreters.com (free, online) and am quite enjoying it. It builds an ad-hoc parser and you could easily swap in an s-expression parser.

It first builds an AST-based interpreter in Java (I used #DylanLang instead) and then builds a byte code interpreter in C for the same language.

This book is really refreshing compared to other compiler books I've used. It's very hands-on; much less theoretical.

craftinginterpreters.comCrafting Interpreters
Replied in thread

@ringtailringo

There's definitely an aspect of "don't worry, be happy" to dynamic error handling. In my experience a large % of errors are unrecoverable anyway (aside from via user interaction) so one or two strategically placed condition handlers (e.g. in the main loop) are usually enough.

And obviously document public APIs with any explicitly signaled errors.

There are some standard CL functions, like parse-integer, that return an error value (e.g., nil) much like in Go, except you're not required to check it. I think there's a decent argument for forcing the caller to deal with the error there, but you'd never convince the CL community to require it. (It's one of the ways the #DylanLang ethos differs from #CommonLisp... github.com/dylan-lang/opendyla)

GitHubopendylan/sources/common-dylan/format.dylan at master · dylan-lang/opendylanOpen Dylan compiler and IDE. Contribute to dylan-lang/opendylan development by creating an account on GitHub.