
Show HN: World's fastest website generator with scripting language and shell - qu83rt
https://nift.dev
======
prashanth1k
The templating system looks crisp and great. Nift documentation goes far
beyond simple docs - that's a lot of practical advice (thank you). The support
for scripting is welcome - although I come from a different world and will
take time wrapping my head around it.

Great work overall!

I am sure this is a great tool for builders - sites are quite easy to
replicate and the way templates are setup clearly helps.

At the same time, I think in order to really take off for the general
population (incl. me) -

\- It will be great if markup (HTML, or otherwise) could be "cleanly"
separated from content (image, text, markdown etc)

\- .. and, not worrying about scripting and its many avatars

~~~
qu83rt
Thanks for the feedback! Nift can certainly be used without any scripting
(whether it be pre/post build scripts, injecting output from external scripts
or its own in-built scripting abilities with n++/f++).

I do worry that things like Lua/ExprTk etc. might scare people who just need a
basic static website generator, as I think Nift should still be one of the
easiest to use for basic html/css/js websites.

One thing I hope I've succeeded at is ensuring the barebones of a project is
quite basic (check out what you get if you run `nsm init-html` in an empty
directory if you try installing). If you want you can easily just use Nift's
functionality for injecting/inputting content from files at build time then
just use basic html/css/js/etc. for your website, while also aiming to be able
to integrate with basically any other tool you could possibly want.

It is quite a bit of work to set up things from scratch, but as you identified
it's hopefully quite easy to set up templates/boilerplate to be replicated for
other projects. In that regard Nift attempts to be unopinionated.

I am not quite sure what you mean by separating markup from content either?
The templating system is extremely flexible with how you can lay your files
out, inject content from basically wherever etc..

------
qu83rt
Compare the f++ script
[https://pastebin.com/5FM7Hzef](https://pastebin.com/5FM7Hzef) which takes 3
seconds with the bash script
[https://pastebin.com/RTXXEHBg](https://pastebin.com/RTXXEHBg) which takes 3
minutes on my machine for example (both scripts create and delete 100k empty
files).

Nift can build all of a basic 100k page website in ~11s and do an incremental
build in ~2.25s on my 2014 11" i5 macbook air running Ubuntu 18.04, it uses
under 500mb memory building the same basic website scaled to 1 million pages.

------
jlbnjmn
Can you explain what this is?

I read the homepage.

~~~
qu83rt
It started out as basically just a static website generator but has grown in
to having quite a few things.

The primary goal of Nift is still generating websites but not just static ones
(and at scale, can handle generating websites with millions of pages). For
generating websites you can manage projects and generate them. The best way to
learn about this are probably the tutorials
([https://nift.dev/resources/tutorials.html](https://nift.dev/resources/tutorials.html))
which will both point you towards template website repositories you can fork
and clone to make websites with, but also initialise a basically empty project
using `nift init-html` and give you an idea of how to manage, edit, build etc.
a project (you could also use Nift for things like making research
papers/books with pandoc, as a pre-processor for any programming language,
etc.).

Nift has its own template language n++ to use in the template/content files
used to build webpages (you can use it for generating css/scss/js/ts/etc.
files as well), though you can also use other template languages combined with
n++ as well.

Due to being a template language, doing any actual programming related tasks
with n++ is a bit verbose, so using very similar syntax and essentially the
same underlying code I added a scripting language called f++. The main purpose
for adding f++ was for use with Nift as a website generator, but it works fine
as its own scripting language as well, and the f++ REPL works very well as a
shell extension (if one installs Nift, start the shell with `nsm sh` and you
should be able to use it basically the same as your normal shell, but you also
have a full type system, everything from f++, Lua embedded, ExprTk embedded
for mathematical expressions, etc. etc.), for example see the other comment on
this post from me with a link to an f++ script and a bash script where they do
the same thing and the f++ script takes 3 seconds whereas the bash script
takes 3 minutes!

If anyone is interested in learning more about Nift or having a play, feel
free to email me (contact[at]n-ham.com).

