Slim
mal
Our great sponsors
Slim | mal | |
---|---|---|
30 | 94 | |
5,269 | 9,764 | |
0.4% | - | |
7.8 | 0.0 | |
7 days ago | 9 days ago | |
Ruby | Assembly | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Slim
-
Building a syntax highlighting extension for VS Code
I spent a few days of my spare time building a VS Code extension that would bring better syntax highlighting for the Slim template language to the editor. I quite enjoyed most of the process so I’d like to share what I learned.
-
Rails 7.1 Released
I think they mean Server Side Rendering (normal rails controllers/views), and Slim is just the name of the templating engine. It's a little nicer than the default ERB. https://github.com/slim-template/slim
There's also SSR with react and other js frameworks, but I don't think that's what they meant.
-
How to build a website without frameworks and tons of libraries
I use something very similar on https://lunar.fyi and https://lowtechguys.com but I wouldn’t call this “simple” anymore.
They use Jinja templating, I prefer Slim (https://github.com/slim-template/slim#syntax-example) which has a more Pythonic syntax (there is plim [0] in Python for that)
I use Tailwind as well for terse styling and fast experimentation (allows me to write a darkMode-aware and responsive 100 line CSS in a single line with about 10 classes)
For interaction I can write CoffeeScript directly in the page [1] and have it compiled by plim.
I run a Caddy static server [2] and use Syncthing [3] to have every file save deployed instantly to my Hetzner server.
I use entr [4] and livereloadx [5] to rebuild the pages and do hot reload on file save. All the commands are managed in a simple Makefile [6]
———
You can already see how the footnotes take up a large chunk of this comment, this is not my idea of simple. Sure, the end result is readable static HTML and I never have to fight obscure React errors, but it’s a high effort setup for starters.
Simple for me would be: write markdown files for pages, a simple CSS for general styling (should be optional), click to deploy on my domain. Images should automatically be resized to multiple sizes and optimized, videos re-encoded for smaller filesize etc.
I have mostly implemented that for myself (https://notes.alinpanaitiu.com/How%20I%20write%20this%20blog...) but it feels fragile. I’d rather pay for a professional solution.
[0] https://plim.readthedocs.io/en/latest/
[1] https://github.com/FuzzyIdeas/lowtechguys/blob/main/src/rcmd...
[2] https://caddyserver.com/docs/command-line#caddy-file-server
[4] https://github.com/eradman/entr
[5] https://nitoyon.github.io/livereloadx/
[6] https://github.com/FuzzyIdeas/lowtechguys/blob/main/Makefile
-
Do Modern Programming Languages Have to Care About Line Length?
Checkout slim https://github.com/slim-template/slim it's a templating language
-
How to use View Transitions in Hotwire Turbo
The template renders the tag and inside it the link and the counter itself (the Slim template language and Tailwind styling are used here, hopefully the notation is sufficiently self-explaining):
-
Styling Simple Form forms with Tailwind
This config sets a ”medium“ font weight for our form labels by default. Now, suppose we want a specific input’s label to be bold instead, we might want to try the following naive approach (we’re using the Slim template notation here):
- Am I the only one who takes top priority in code neatness? Even if the code works, I HAVE to make it look neat. It absolutely must look neat in my mind. I cant really work peacefully if the code isnt neat. It just has to be neat. Does anyone else feel this way?
-
Form error in a rails view
Consider slim: "Slim - A Fast, Lightweight Template Engine for Ruby" http://slim-lang.com and simple_form "GitHub - heartcombo/simple_form: Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup." https://github.com/heartcombo/simple_form
-
Tailwind CSS class sorter – the custom way
There are quite a few good ones already but, as it turned out, we hit one blocker or another with each of them. Our biggest issue was that we use Slim in our project, a template format which most of the tools don’t support.
-
The KDL Document Language
reminds me of slim templates, but not just Ruby
mal
-
Build Your Own Lisp
Great way to learn C! If you want to learn languages, implementing a lisp interpreter is a great exercise, and lots of fun too.
If you're curious but want a more language-agnostic guide, mal (Make a lisp) is a language that has a guide you can follow along with basically any language, and if you get stuck, you can look at already implemented versions in practically any language: https://github.com/kanaka/mal
Personal favorite implementations of mal: nasm (assembly) (https://github.com/kanaka/mal/tree/master/impls/nasm) and wasm (https://github.com/kanaka/mal/tree/master/impls/wasm)
Here is one implementation of a lisp (mal specifically) in matlab: https://github.com/kanaka/mal/blob/dcf8f4d7b9cf7b858850a04a0...
Only 260 lines of code, pretty concise :)
- Ask HN: What projects did you build to get better as a programmer?
-
Can you beat my dad at Scrabble?
So I started some hobbyist game dev using Unity and realised that the full process of making a game has dependencies on a mass of lower-level skills including lighting virtual environments. As a hobbyist photographer I could see some useful analogies from lighting studios and other scenes
So I pivoted, and eventually made money, not from selling a game, but from developing tutorials about digital lighting. I was also able to contribute to a project at work that was making a product based on commercial games engine, not by actually coding it, but by helping to better estimate the costs of the asset generation required.
Coding Unity object scripts in C# also got me back into programming, and I went on to successfully build a self-hosting lisp interpreter following the Make a Lisp guidelines [0].
[0] https://github.com/kanaka/mal/blob/master/process/guide.md
-
Advice for a first-time designer of my own original programming language? Presently writing the interpreter!
Hijacking the top comment to add https://buildyourownlisp.com and https://github.com/kanaka/mal
-
Writing a lisp
Make a Lisp is a nice starting point.
There is a free book online if you prefer to learn C, or use Mal and implement a Lisp interpreter in any language you wish to learn, step by step by looking up needed parts.
-
Make a LISP in Rust tutorial starting tomorrow.
First some details. We will be following along with MAL which is a language-agnostic guide to creating a LISP. Here is the link https://github.com/kanaka/mal. My goal will be to do one live video for each stage (there are 11 stages). My recommendation is for everyone to attempt the stage themselves before they watch my tutorial. Not because I won't explain it as best as I can. But because I think most people will surprise themselves with their ability to complete it without help. The best way to learn is to write code yourself so even if you do watch me, try implementing it yourself afterwords without looking at my code.
-
Hello
> make my own toy programming language, probably a Lisp dialect
I've learned a lot from the "Make a Lisp" project. If you haven't seen it, I'm sure you will enjoy studying it. https://github.com/kanaka/mal
-
Ask HN: What piece of code/codebase blew your mind when you saw it?
For me it was the "Make a Lisp" project. Reading the architectural diagram of a Lisp interpreter, and browsing its implementation in many (87) programming languages.
Especially where the guide explains how tail-call optimization works, my mind was blown.
https://github.com/kanaka/mal/blob/master/process/guide.md#s...
Studying the project changed the way I understand code. Since then I've created my own little Lisps in about three or four versions/languages. Next I'd like to write one in WebAssembly Text format, which is already in a Lisp-shaped syntax.
What are some alternatives?
Haml - HTML Abstraction Markup Language - A Markup Haiku
Liquid - Liquid markup language. Safe, customer facing template language for flexible web apps.
Hamlit - High Performance Haml Implementation
Sanitize - Ruby HTML and CSS sanitizer.
paip-lisp - Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"
Tilt - Generic interface to multiple Ruby template engines
tachyons - Functional css for humans
Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
Curly - The Curly template language allows separating your logic from the structure of your HTML templates.
sectorlisp - Bootstrapping LISP in a Boot Sector
LaTeXML-Ruby - A Ruby wrapper for LaTeXML
Webpacker - Use Webpack to manage app-like JavaScript modules in Rails