Hi there!

We're pretty excited to share that liquidsoap has officially moved to
version 2.0.0 with some big changes already in or about to come. Here's a
breakdown:


   - *Exceptions*

You can now throw and catch exceptions. The syntax is as follows:

err = error.register("My Error")

# Catch only our error and another one:
try {
  .. some code ..
} catch e in [err, err2] {
  message = error.message(e) ?? "no message"
  print("error: #{message}")
}

# Catch all errors:
try {
  .. some code ..
} catch e {
  message = error.message(e) ?? "no message"
  print("error: #{message}")
}


You can use exceptions to simplify your code, for instance exit a loop
immediately. Also, with errors handling, we are able to relax some or our
requirements so, typically, no more required default argument in lists!


   - *Optional values*

If you look closely at the script above, it also introduces a new ??
constructor.
This constructor is used with a new type of *optional* data. Here's an
example:

# error.message;;
- : (error) -> string? = <fun>


Variables of type foo? are *optional* variables, which means that they may
not defined, similarly to null or undefined in javascript. The syntax x ??
some_value returns either the content of x , if defined, or some_value if
not defined.

This is useful to make scripts more flexible and, for instance, not have to
specify all values ahead of times. Typically, list default values are now
of an optional type.


   - *Modules*

We now support modules! This means that, for instance, source.queue refers
to the queue method of the module source. Even more, modules are actually
regular values decorated with methods. For instance:

# x = 123;;
x : int = 123

# def x.foo () =
  "hello!"
end;;
x.foo : () -> string = {"hello!"}

# x;;
- : int.{foo : (() -> string)} = 123.{foo={"hello!"}}


This has some truly awesome applications:

   - Sources are now decorated with the operators you can apply on them, so
   you can for instance call s.skip() directly on a source value s or queue
   a file to a queue by calling s.push(filename). *Note: These methods are
   not all implemented yet!*
   - You can open a module, bringing all its value to the top-level. The
   plan with this is to be able to have a default API that works with
   audio-only or, if you add open video , have the same API but requiring
   audio and video this time, without changing the operators. Think for
   instance fade.in requiring audio only by default and video.fade.in requiring
   audio and video.



   - *More syntax extensions*

We want to bring more syntax extensions, inspired by other languages. We
have already added infix if:

# x = true;;
x : bool = true

# x ? "x is true" : "x is false";;
- : string = "x is true"


And list construction/deconstruction:

# x = [1,2,3];;
x : [int] = [1, 2, 3]

# x = [...x, 4, 5];;
x : [int] = [1, 2, 3, 4, 5]

# let [x, y, ...z] = x;;
x : int = 1
y : int = 2
z : [int] = [3, 4, 5]



   - *Extensible frame content*

This work is the first step toward supporting encoded content. We are not
able to use arbitrary content for our internal frames. Our default content
types are: pcm for audio, yuv420p for video and our internal midi
 representation.

Next, we plan on adding:

   - FFmpeg encoded packet to support encoded content end-to-end when
   possible
   - FFmpeg raw frame to support ffmpeg filters etc. without having to copy
   data back and forth.
   - Layered video content, to provide and efficient implementation of
   video overlay operators, inspired by how OBS works


Needless to say, the prospect of supporting these new content types is
quite exciting!

However, this work has changed the syntax for source content types, which
may bring existing scripts. Likewise, the documentation is now out of date
and needs to be worked on. Any contributor on this front would be warmly
received for sure! :slightly_smiling_face:
Development status

While all these changes are exciting, they also mean that our main branch
is currently in a state of flux. We welcome any interested user or
contributor to come play with it but be mindful that it may break and/or
take a minute to reach production quality. However, early feedback is
greatly appreciated as it helps us move faster.

Also, we highly recommend anyone working with video and/or Gstreamer to
come try the latest code and see if our new support for FFmpeg decoder and
encoder can work for them since we do expect FFmpeg to take over and
Gstreamer to be deprecated in the future.
Current stable release

Admittedly, there's been a lag in dealing with issues lately with all the
heavy work being done in the main branch. However, we do plan on catching
up with pending issues and bugs shortly. To that extend, there is already a
1.4.3 pre-release that includes a fix for a pretty nasty bug related to
clock type inference here:
https://github.com/savonet/liquidsoap/releases/tag/v1.4.3-pre-release

We have updated our CI scripts and we are now able to provide debian
packages and windows build for the latest commit on the
v1.4.3-pre-release branch
through the link above. Feel free to check it regularly, test a package and
report anything to us!
Build infrastructure

Lastly, as explained above, we now have a very nice, tightly integrated CI
that generates debian packages for each branch (and windows build hopefully
soon). This means that you can grab a build of any given commit by looking
at it's associated github action run, for instance:
https://github.com/savonet/liquidsoap/actions/runs/156729427

Long-term, we will most likely drop our debian package repository and point
users to those runs. The cost and resource required to maintain our own
infrastructure is just a little more than what we are comfortable handling
and also, the repository is already bloated with too many packages and will
keep this way. It is better to just point users to a specific download and
more clear as to what exactly you are installing..

We hope that these news make y'all as excited as we are. Check back again
soon to see how far we are with these!
-- Sam and Romain
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to