CLIPSockets

110 views
Skip to first unread message

Ryan Johnston

unread,
May 8, 2024, 1:23:41 PM5/8/24
to CLIPSESG
Hey, CLIPS group! I wanted to share something I've been working on. CLIPSockets is an educational exploration into a low-level sockets library providing networking capabilities to CLIPS. This means: you can accept or make network requests to ip/port combinations directly within CLIPS!

I following the source code present in filertr.c very closely in order to make design decisions around the library.

There are example server/client code present in the repo demonstrating IPv4, IPv6 and unix socket communication.

In the past, I've made applications in Go and C directly that effectively would "wrap" a CLIPS environment and relay strings into and out of the CLIPS environment in order to send data over the network. With this library, you can leverage the built-in I/O functions like (readline), (read) and (printout) to read to/write from clients connected via the internet.

Let me know what you all think!

Руслан Сорокин

unread,
May 10, 2024, 4:37:53 AM5/10/24
to CLIPSESG
Great! 

This is remarkable broadens CLIPS possibilities to communicate with external world. Congratulation! Little technical question: How to switch, for example to other CLIPS version, is it enough to replace .c- files in your distribution with same files from official files in new CLIPS distribution?

Sincerely,
  Ru

среда, 8 мая 2024 г. в 20:23:41 UTC+3, Ryan Johnston:

Ryan Johnston

unread,
May 10, 2024, 5:59:46 AM5/10/24
to clip...@googlegroups.com
Thanks, Ru! I'm not entirely sure how well it'd work between versions. I had to change a few things to the base 6.4.1 source code. I outlined some of the changes at a higher level here: https://github.com/mrryanjohnston/CLIPSockets?tab=readme-ov-file#small-technical-braindump

If you look back through the commits, the first commit in that repo is adding the clips 6.4.1 source code. The second commit is where I added my changes on top: https://github.com/mrryanjohnston/CLIPSockets/commit/f15e636c02d6a1082b8b3f27bb5483a32270a8d6

I've not tested it with other versions of CLIPS, but my instincts tell me it'd need some work to get it to work properly rather than act as a "drop in."

--
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
 
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.

--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe
 
Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
---
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipsesg+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/a44db401-53dc-40d2-9a5b-deb039f8d77en%40googlegroups.com.

Ryan Johnston

unread,
May 21, 2024, 1:08:17 AM5/21/24
to CLIPSESG
I got CLIPSockets working with the latest from svn released today: https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/70x/core/

So latest main should now be ready for 7.0.0 when it is released :)

If you want to use 6.4.1 instead, I have the latest working version using 6.4.1 as a tag in the CLIPSockets git repo.

Руслан Сорокин

unread,
May 22, 2024, 2:48:48 AM5/22/24
to CLIPSESG
Good news Ryan!
I have used in my latest project version 6.4.2, that is a bug fix of 6.4.1.
Can I use your commits with it?

вторник, 21 мая 2024 г. в 08:08:17 UTC+3, Ryan Johnston:

Руслан Сорокин

unread,
Oct 12, 2024, 5:24:35 AM10/12/24
to CLIPSESG
Hi Ryan!

Today I have cloned CLIPSockets and tried to make. I'v got this error message:
...
gcc -c -DLINUX -std=c99 -O3 -fno-strict-aliasing -Wall -Wundef -Wpointer-arith -Wshadow -Wstrict-aliasing -Winline -Wredundant-decls -Waggregate-return userfunctions.c
userfunctions.c:55:10: fatal error: magic.h: No such file or directory
   55 | #include <magic.h>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [makefile:92: userfunctions.o] Error 1
make[1]: Leaving directory '/home/ru/CLIPS/CLIPSockets/src'
make: *** [makefile:2: all] Error 2

What to do next? Thanks in advance.

Sincerely,
  Ru

среда, 22 мая 2024 г. в 09:48:48 UTC+3, Руслан Сорокин:

Ryan Johnston

unread,
Oct 12, 2024, 11:15:03 AM10/12/24
to CLIPSESG
Sorry about that, Ru! I added a function that added image magick as a dependency. I just now pushed a change that allows you to explicitly remove this dependency with `make NO_IMAGE_MAGICK`. Alternatively, you should install the image magick lib on your machine. For Ubuntu, `sudo apt install libmagic-dev` did the trick for me.

Pull latest and let me know if it's fixed for you

Руслан Сорокин

unread,
Oct 12, 2024, 11:58:18 AM10/12/24
to CLIPSESG
Great! `sudo apt install libmagic-dev`  did the trick for me too!

But header of started clips says 'CLIPS (6.30 3/17/15)'.
I thought it will be "CLIPS 7.0.x released on 5/12/24" as from README.

суббота, 12 октября 2024 г. в 18:15:03 UTC+3, Ryan Johnston:
Reply all
Reply to author
Forward
0 new messages