#Infix

2025-01-18

Some things I'm especially proud of in plusminus (my Python package for parsing and evaluating infix notation arithmetic):
- |absolute value| expressions
- ° symbol as a unary postfix operator, to convert degrees to radians: sin(π/2) vs. sin(90°)
- exponents ² and ³
- √ and ³√ operators (both unary and binary, so you can write 2√2)
- mathematical constants e, π, φ, and τ
- set operators ∈, ∉, ∩, and ∪
- safe eval of untrusted inputs
Try it at ptmcg.pythonanywhere.com/plusm
#python #parsing #infix

2024-12-28

For most (all) of our automated testing in #Infix we use #Python which is amazing in every way and really fit for purpose, but in the #sysklogd project (and many others) I rely on plain #POSIX shell scripts, and OMG it's so easy to forget how powerful #shell scripting is!

you╭👺+300╭🐈x5╭⁂+3╭(Ⓐ+aunspeaker
2024-09-12

also i am fucking TEMPTED to implement `std::ops::{Add, Sub, Div, Mul}` for layout... only i'm pretty sure that won't work at all

with custom operators comes to mind

2024-08-09

Spent my last day of vacation updating the R2S to support secure boot and read-only rootfs to make it a pure citizen of #infix really great feeling when it started the locked down U-Boot verified the signature of the primary partition and booted up perfectly 😎✌️

2024-07-06

Almost done porting #Infix to our first #riscv64 target, a #VisionFive2 so cool 😎

2024-06-16

Great feeling to have lawn mowed, gravel walk cleaned, parts of jungle area in the back reclaimed. All while contemplating the .cfg file upgrade mechanism in #infix

2024-05-15

Yay, #Infix now has PAM support! This means we can proceed with the next steps in our journey towards a new kind of network operating system! 😍 #embedded #NETCONF #YANG

github.com/kernelkit/infix/com

2024-03-01

Aaaaand done! Just like mum used to make em, crisp and clear right out of the oven at GitHub

Another amazing release by the team. This time the focus was on adding OSPFv2 + BFD and Docker containers. Quite a neat feature for a switch or router.

#Linux #networking #NETCONF #infix

github.com/kernelkit/infix/rel

2024-02-25

At least the Docker container support for #Infix was merged today. Super proud of our little operating system growing up 😍

github.com/kernelkit/infix

Найменшенькийbalaraz@social.net.ua
2024-02-22

У Haskell можна оголошувати свої оператори. Вони можуть складатись з одного або кількох символів. Дозволяються наступні символи ~!?.@#$%^&*-<=>+\|/. Також можна використовувати символ :, але він повинен розташовуватись у середині або кінці, не на початку.

Оголошуються оператори в синтаксисі схожому на виклик

x *+* y = x^2 + y^2

або можна використати префіксну форму

(*+*) x y = x^2 + y^2

Примітка: Функції можна оголошувати в інфіксній формі.


ЗВЕРНІТЬ УВАГУ!: Усі оператори є бінарні окрім унарного мінуса який обовʼязково обгортають в круглі дужки.

Усі оператори мають пріоритети для правильної роботи, саме за їхньої допомоги вираз 2 + 2 * 2 вичислюється правильно й результат дорівнюватиме 6, а не 8. Є десять рівнів пріоритету від нуля до девʼяти.

Але що робити з кількома операторами якщо у них один пріоритет, це може бути кілька викликів одного оператора. Тут потрібно використати асоціативність. Є два види асоціативності ліва і права. Ліва асоціативність це коли оператори застосовуються по черзі зліва на право, а права навпаки.

(2 + 1) - 5 -- ліва
2 + (1 - 5) -- права

Оголошується асоціативність оператора за допомоги ключових слів:

  • infixl - ліва
  • infixr - права
  • infix - відсутня

Якщо асоціативність відсутня, то такий оператор не можна викликати кілька раз або з іншими операторами того ж пріоритету в одному виразі.

Вказується асоціація і пріоритет у такому синтаксисі infix[rl] <prio> <operator>. Вказується це, або до, або після оголошення самого оператора, але в інтерпретаторі це мусе бути одним рядком, тому їх потрібно розділити крапкою з комою.

infixl 7 +**
a +** b = a^2 + b^2

Якщо цього не вказати, то оператор матиме ліву асоціативність і девʼятий, найвищий, пріоритет.

Дізнатись цю інформацію про оператор можна за допомоги команди інтерпретатора info.

ghci> infixl 7 +**; (+**) a b = a^2 + b^2
ghci> 5 +** 4
41
ghci> :i (+**)
(+**) :: Num a => a -> a -> a 	-- Defined at <interactive>:1:15
infixl 7 +**

Якщо явно не вказати infix, то й у виводі цієї команди не буде такої інформації.

У Haskell немає вбудованих операторів. Всі стандартні оператори оголошені в стандартній бібліотеці. Є такі стандартні оператори.

infixr 8   ^, ``
infixl 7   *, /, `div`, `mod`
infixl 6   +, -
infix  4   ==, /=, <, <=, >=, >

Це не всі, але інші ми розглянемо пізніше. Оператор `` це оператор виклику функції в інфіксному форматі. Виклик функції у префіксному вигляді має праву асоціативність і девʼятий пріоритет.

/= це оператор не рівності, в інших мовах зазвичай він виглядає !=. Оператори порівняння не мають асоціативності, тому їх не можна обʼєднувати в ланцюжок.

#програмування #haskell #hs #оператори #створення #оголошення #асоціативність #пріоритети #стандартні #стандартна #бібліотека #інтерпретатор #ghci #infix #infixl #infixr #виклик #функції #функцій #префіксна #інфіксна #форми

2024-02-07

Trying to put together some material for a series of workshops on #infix there’s so much to cover but it’ll be mostly about #buildroot since that’s what we’re building on.

There’s something to be said about building on a solid foundation. But when you know, you know.

2024-02-06

We also opened up the public project plan and roadmap for #infix today. We’ll be moving more private stuff here, and some new customers will be having direct access to the board.

github.com/orgs/kernelkit/proj

2024-02-06

Container support v1 in #infix is almost done. Only one little thing to address in the YANG model and a couple more regression tests.

First demo for end customer Thursday 😎

2024-01-22

So nope, #skopeo doesn’t seem to support multi-arch manifest generation. Too bad, a really great tool otherwise. Had to resort to #buildah which works right out of the box in a GitHub action.

Easy peasy container squeezy 😎

That was the biggest hurdle to #Infix little AppStore! Onwards and upwards 😊

2023-12-14

Got the massive changes to the DHCP client merged today. Now I’m on to add proper NETCONF support for containers to #infix

The pace of our development rn is ridiculous. Hardly keeping up myself, and I’m in the middle of it all! Having so much fun creating this little operating system … and now even more customers have come knocking 😳😭😍🙏

2023-12-13

(I'm talking about regression tests for your favorite network operating system, #Infix :-)

2023-11-01

@troglobit nice work! And two more distros I need to try at some point, I think :-).

I'm also curious what your thoughts on #OpenWrt are. As that's what I've been mostly working with on WiFi routers so far. And what you think #Infix and #Buildroot are doing better or what #OpenWrt should learn and could adopt from them.

2023-08-15

I mean, it’s near impossible to learn and understand all the nuances of YANG. Spent the better part of the afternoon trying to figure out a basic replacement deviation.

But hey, the alternative would be even worse. I’d much rather spend my time modelling my system than debugging if statements and custom regexps in my C code.

#netconf #yang #opensource #infix

2023-04-07

Today's vote-on-it #infix #RSF: preferred chicken stock

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst