~technomancy

~technomancy/fennel

Last active a month ago
View more

Recent activity

Conference videos a month ago

From Phil Hagelberg to ~technomancy/fennel

Hey everybody!

I'm heading home from a successful FennelConf 2019. Thanks to all the
speakers who put a lot of work into the excellent talks, to Justin Smith
for hosting us at our venue, and to Ken Restivo for helping set up an
A/V streaming and recording arrangement. We were able to stream the
talks as the conference happened, and three of the four talks were
recorded.

You can watch the videos at https://conf.fennel-lang.org.

Looking forward to seeing you all next year!

-Phil

Re: Optimizations in Lua code generation 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Phil Hagelberg <phil@hagelb.org> writes:

> I loaded the new version into EXO_encounter-667, which is my largest
> Fennel codebase. It removed all but 3 unnecessary IIFEs (at least, those
> 3 seemed unnecessary to me; maybe they in fact are needed.)

Here are the IIFEs I saw; turns out there's 3:

    (let [layer (: map :addCustomLayer "player" 8)]
      (set layer.sprites [(unpack state.rovers)])
      (tset layer.sprites 0 state.probe)
      (set layer.draw (partial draw.player world state)))

    ;; local function _0_(...)

Re: Optimizations in Lua code generation 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Calvin Rose <calsrose@gmail.com> writes:

> This is a heads up on some changes I have been working on for Fennel
> having to do with code generation. Some discussion on IRC has been about
> how the Fennel compiler (0.2.1) was generating anonymous functions that
> are immediately called (IIFE, or Imediately Invoked Function Expression)
> in many cases, even when not strictly necessary.

Nice work! I only find the need to look at the compiled output
increasingly rarely, but "too many IIFEs" was basically my only
complaint about the readability when I did need to.

I loaded the new version into EXO_encounter-667, which is my largest
Fennel codebase. It removed all but 3 unnecessary IIFEs (at least, those

Fennel 0.2.1 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Hey folks.

Yesterday Calvin just pushed out version 0.2.1 of Fennel, which fixed a
few bugs we found right after the 0.2.0 release:

* Add not= as an alias for ~=
* Fix a bug with in-scope? which caused pattern matching outer unification to fail
* Fix a bug with variadic ~= comparisons
* Improve error reporting for mismatched delimiters

Happy hacking!

-Phil

Re: Named lets in Fennel 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Justin Smith <noisesmith@gmail.com> writes:

> On Fri, Jan 18, 2019 at 1:32 PM Jason Valencia <jasval@airmail.cc> wrote:
>>
>> Scheme has a concept of "named lets", essentially a let you can call
>> from within itself, which is useful for recursion.
>>
>> R5RS [1]:
>> > (let <variable> <bindings> <body>)
>
> so is this effectively (fn x [] ...) except x is only visible inside
> the fn, and not to the surrounding environment?

Yeah, I would say we already have this construct more or less. Is there

Re: Plans for 0.2.0 3 months ago

From Phil Hagelberg to ~technomancy/fennel

Phil Hagelberg <phil@hagelb.org> writes:

> Any other ideas for what we might want to include in the next release?
> Or questions about the above?

A friend of mine is a debian developer who's considering packaging
Fennel in the upcoming Debian Buster release, which has a freeze in a
week or two.

If we could cut a release of Fennel 0.2.0 it would make it easier for
her to do this. Is there anything else that should be considered for the
release?

Calvin: I was assuming you'd want to do the release, but I can handle it

Re: behavior of -> etc. 3 months ago

From Phil Hagelberg to ~technomancy/fennel

Calvin Rose <calsrose@gmail.com> writes:

> In general, I think (-> x f g print) looks nicer than (-> x (f) (g)
> (print)).

Cool; I have no objection to this. I just wanted to make sure we merged
it for the right reasons rather than just doing what Clojure does.

-Phil

[PATCH] Allow inline macros. 3 months ago

From Phil Hagelberg to ~technomancy/fennel

This splits up `require-macros' into two parts:

* The bit that loads the macro modules has been split into a helper
  `loadMacros' function which is only concerned with that one job.

* Once we have a table of name/macro-function then we pass that to
  `doMacro', which takes each of the macro functions, turns them into
  specials, and inserts them into the specials for the given scope.

* doMacro can also be used on its own thru the new `macros' special
  which simply takes a table that gets evaluated in compiler scope.

For instance, from the test suite:
[message trimmed]

Plans for 0.2.0 3 months ago

From Phil Hagelberg to ~technomancy/fennel

There's been a lot of development on Fennel in the past few weeks! We're
about due for another release before too long. We've got this already on
master:

* Add `match` macro for pattern matching
* Add optional GNU readline support for repl
* Fix a bug where runtime errors were not reported by launcher correctly
* Allow repl to recover gracefully from parse errors
* A man page

With open work to implement these things:

* Support key/value tables when destructuring
* Quote and unquote

Re: Breaking out of the loop 4 months ago

From Phil Hagelberg to ~technomancy/fennel

Slava Lopata <hayohayo@tuta.io> writes:

> Yes, I see. This one is indeed very specific. Yet, I assume, even then
> it may be less efficient than Lua's for with break/return?

I can't think of a reason it should be; Lua has proper tail calls, so
the recursion here basically compiles to a simple goto.

> Interesting, thanks. Don't all current looping constructs are statements
> though?.. (each), (for), (while).

No, lisps don't have statements; these are simply expressions which
return nil.