Networking #1093
Replies: 5 comments 4 replies
-
On 10/2/22 14:11, SethMarshall wrote:
Hello. Thank you for creating this project. Modula is a lot of fun.
Are there any classes in the libm3 library (or any other importable library) for socket programming? I see the m3-www folder of the repo, but *import("m3-www")* in the m3makefile and/or *IMPORT HTTP* in Main.m3 is not recognized and will not compile.
Directory m3-www is not a CM3 package. There are several immediately inside it that are
packages. (Evidence: they have a src subdirectory.) Of those, only m3-www/web
and m3-www/proxy are built in the CM3 installation. The one you want is m3-www/http.
So I was able to fix the failures you see by going into m3-www/http/src and issuing
first "cm3", then "cm3 -ship". This builds and installs the package http. Now I see
this in my install directory:
/usr/local/cm3$ find . -iname "*http*"
./lib/libhttp.a
./lib/libhttp.so
./lib/libhttp.so.5
./pkg/webcat/src/HTTPCat.m3
./pkg/http
./pkg/http/src/HTTPControlValue.i3
./pkg/http/src/HTTPControlValue.m3
./pkg/http/src/HTTPApp.m3
./pkg/http/src/HTTPPayment.i3
./pkg/http/src/HTTPPayment.m3
./pkg/http/src/HTTP.m3
./pkg/http/src/HTTPProxy.i3
./pkg/http/src/HTTPApp.i3
./pkg/http/src/HTTP.i3
./pkg/http/src/HTTPControl.i3
./pkg/http/src/HTTPProxy.m3
./pkg/http/src/HTTPControl.m3
./pkg/http/AMD64_LINUX/libhttp.a
./pkg/http/AMD64_LINUX/libhttp.so
./pkg/http/AMD64_LINUX/libhttp.m3x
./pkg/http/AMD64_LINUX/libhttp.so.5
./examples/httpd
./examples/httpd/src/HTTPD.m3
And this program compiles:
m3makefile:
import("http")
implementation("Main")
program("HTTPClient")
Main.m3:
MODULE Main
; IMPORT HTTP
; TYPE Style = HTTP . Style
; VAR V : Style
; BEGIN
END Main
.
Is the only solution for one to manually copy the relevant module and interface files into a solution and then import them as *MODULE("")* in the m3makefile?
Also, is there any example code anywhere which demonstrates basic networking functionality?
The build of http done, try looking at /usr/local/cm3/examples/httpd/src/
… —
Reply to this email directly, view it on GitHub <#1093>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNDGCISR4VDGMFHGY43WBHM63ANCNFSM6AAAAAAQ3AWTKE>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Couple things.
This is the contents of my usr/local/cm3/pkg. Not seeing m3-www there at all in fact. (My previous mention of seeing m3-www was in regards to the repo here on github) bitvector m3bundle m3quake patternmatching table-list
When I run cm3 in usr/local/cm3 I get the following: quake runtime error: unable to open "/usr/local/cm3/bin/config/AMD64_LINUX" for reading This is despite the fact that I have given all permissions to that folder. Tried deleting it and recreating it. Tried just deleting it. Am not too experienced with Linux so I may be missing something. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
-
On 10/3/22 13:10, SethMarshall wrote:
Couple things.
Of those, only m3-www/web and m3-www/proxy are built in the CM3 installation.
This is the contents of my usr/local/cm3/pkg. Not seeing m3-www there at all in fact. (My previous mention of seeing m3-www was in regards to the repo here on github)
bitvector *m3bundle* *m3quake* patternmatching table-list
cm3 *m3core* *m3scanner* realgeometry tcp
cm3ide *m3front* *m3tools* set tempfiles
digraph *m3linker* mklib slisp unittest
libm3 *m3middle* mtex sortedtableextras windowsResources
*m3back* *m3objfile* parseparams sysutils
So I was able to fix the failures you see by going into m3-www/http/src and issuing
first "cm3", then "cm3 -ship". This builds and installs the package http. Now I see
this in my install directory:
When I run cm3 in usr/local/cm3 I get the following:
Run cm3 and cm3 -ship in m3-www/http/src. This is where the source code for the
package http is. /usr/local/cm3 is all compiled/installed stuff. But you can look
in /usr/local/cm3 afterwards to see if the package http got installed.
…
/quake runtime error: unable to open "/usr/local/cm3/bin/config/AMD64_LINUX" for reading/
/--procedure-- -line- -file---/
/include -- /
/4 /usr/local/cm3/bin/cm3.cfg/
/Fatal Error: package build failed/
This is despite the fact that I have given all permissions to that folder. Tried deleting it and recreating it. Tried just deleting it. Am not too experienced with Linux so I may be missing something.
Thank you for your help.
—
Reply to this email directly, view it on GitHub <#1093 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNEZPYVHH5YY7ZKNV5LWBMOQZANCNFSM6AAAAAAQ3AWTKE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Did you look at https://github.com/modula3/cm3/blob/master/m3-comm/tcp/src/common/TCP.i3 A nice example https://github.com/modula3/cm3/blob/master/m3-tools/m3browser/src/TCPServer.m3 |
Beta Was this translation helpful? Give feedback.
-
On 10/3/22 22:30, SethMarshall wrote:
Run cm3 and cm3 -ship in m3-www/http/src.
I don't /have/ m3-www/src anywhere on my system. That's what I was saying before.
In fact, when I run //find / -type d -name 'm3/'/* all I get are the following:
/usr/local/cm3/pkg/m3objfile
/usr/local/cm3/pkg/m3front
/usr/local/cm3/pkg/m3bundle
/usr/local/cm3/pkg/m3scanner
/usr/local/cm3/pkg/m3middle
/usr/local/cm3/pkg/m3tools
/usr/local/cm3/pkg/m3back
/usr/local/cm3/pkg/m3core
/usr/local/cm3/pkg/m3quake
/usr/local/cm3/pkg/m3linker
/usr/local/cm3/examples/m3sh
So no m3-www/src to run cm3 in. And even the folder were there, running cm3 results in the AMD64_LINUX folder mystery error I mentioned above.
Ah, you must not have pulled the git repo. That's where all the source code is,
which you need to compile something additional. /usr/local/cm3 is only compiled
stuff.
It's at https://github.com/modula3/cm3. When you get a local copy of that,
m3-www is directly inside it.
…
Is there anyway to include additional libraries (like http, tcp, etc.) as a pre-built importable package (like libm3) in future releases?
—
Reply to this email directly, view it on GitHub <#1093 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNGUYOEAD2HGWRCG6ZDWBOQGJANCNFSM6AAAAAAQ3AWTKE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. Thank you for creating this project. Modula is a lot of fun.
Are there any classes in the libm3 library (or any other importable library) for socket programming? I see the m3-www folder of the repo, but import("m3-www") in the m3makefile and/or IMPORT HTTP in Main.m3 is not recognized and will not compile.
Is the only solution for one to manually copy the relevant module and interface files into a solution and then import them as MODULE("") in the m3makefile?
Also, is there any example code anywhere which demonstrates basic networking functionality?
Beta Was this translation helpful? Give feedback.
All reactions