freenode/#lisp - IRC Chatlog
Search
13:24:00
stylewarning
I wonder if there’s an expedient way to compile something like Standard ML into Lisp with existing implementations.
13:26:41
scymtym
stylewarning: you may be interested in http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf
13:47:49
phoe
I want to inspect two different objects at a time. I can work around it by opening a second emacs, but I don't want to overkill.
14:51:38
pjb
That's because irc is like google's mapreduce: you ask one question, you get a hundred of answers, and you have to reduce it to a single meaningful information.
15:04:14
jmercouris
I find it best to usually just describe the problem instead of just mentioning it :P
15:06:57
pjb
It's a rare occurence, when somebody asks a question on irc without having some troubles…
15:07:27
megachombass
on the state this is, he gonna notice is copy pasta and i risk way more than a 0
15:08:26
phoe
megachombass: post your problem instead of complaining about it. this way we might actually be able to help you.
15:08:48
pjb
If you asked a question about your troubbles, we could help, but just stating trivia won't.
15:09:49
megachombass
i think that i didnt refactor the code enough of this lisp VM for the teacher dont notice is copy pasta from somewhere else
15:10:31
megachombass
im alone on this project, and i doubt that in the 30h left i have, i can code something correct
15:10:35
jmercouris
If your solution to passing an assignment is refactoring it until it is no longer recognizable as palgueraized (sp?), then you should drop the class
15:11:12
pjb
drdo: sorry, indeed, it was MrDo, not DrDo. https://pausescreen.files.wordpress.com/2010/11/mr-do-snes.jpg
15:11:33
jmercouris
That's unfortunate, post your issue, and assignment, what you've done so far, and let's see if we can help you get through it
15:11:49
jmercouris
We won't give you the answers per se, at least I won't, but I will try to guide you through it
15:12:57
pjb
If you asked about those issues, we could help, but you keep talking about irrelevant things, like troubles and university dropping.
15:13:22
megachombass
if you're up to follow step by step how im trying to implement it, then there is still a chance
15:15:02
pjb
megachombass: also, what I forgot to mention, is that when you build abstrations, you can test them independently from the rest of the program. So you can test it incrementaly, module by module.
15:16:02
megachombass
then lets try it module by module. starting by the choice of the structure. i like the defstruct
15:22:46
Bike
though it is off topic, your class seems to have entirely failed to prepare you for this assignment. assuming others are having problems, you should probably complain.
15:28:23
megachombass
i did attend to that class, as i do with every other class and i do pay attention, simply this is way to hard with the few instructions he gave in class
15:29:03
megachombass
btw this site codeshare.io is great as everyone with the link can interact with the code in real time
15:30:30
jmercouris
So, I have some strange issues with read-line, sometimes when I type backspace in a terminal after invoking read-line, it will print characters "rubout" instead of actually deleting the previous character
15:31:39
dim
CL-USER> (with-open-file (s "/Users/dim/dev/temp/pgloader-issues/733/asist.tiplis.csv" :direction :input :element-type 'character :external-format :utf-8) (format nil "~{~x~^ ~}" (mapcar #'char-code (list (read-char s) (read-char s) (read-char s) (read-char s))))) gives me "FEFF 31 3B 27"
15:31:50
dim
you might recon the UTF-8 BOM, as in https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
15:32:24
dim
Note: The UTF-8 representation of the BOM is the (hexadecimal) byte sequence 0xEF,0xBB,0xBF. A text editor or web browser misinterpreting the text as ISO-8859-1 or CP1252 will display the characters  for this.
15:34:43
megachombass
and for testing if my code still works.... one sec i create a test at the end of the file.
15:34:48
dim
using (format nil "~{~x~^ ~}" (list (read-byte s) (read-byte s) (read-byte s))) shows "EF BB BF", more to the point maybe
15:36:42
dim
my understanding is that it would be safe to always ignore the sequence #xef #xbb #xbf at the beginning of an UTF-8 encoded file... but well... here be dragons?
15:37:03
jmercouris
megachombass: this is some of the strangest looking lisp i've seen with hanging indent parens
15:38:29
jmercouris
does this have to be in Lisp? or did you choose lisp? if it doesn't have to be in lisp, why don't you write it in a language you know?
15:41:29
megachombass
if it was in c, python java or anything i know, i would've created my own vm from scratch and ispire myself on existing VM's. but in lisp im forced to copy pasta an existing one, and even to modify it its a pain for me
15:41:51
pjb
jmercouris: in the preferences of the terminal, in the Advanced tab, you have a checkbox "Delete sends Control-H" this checkbox must be in accord with stty erase.
15:42:28
jmercouris
pjb: It only occurs in ansi-term in emacs, so far on #emacs, the best help I've gotten was "lololol"
15:43:31
pjb
jmercouris: but this is the same principle. What does ansi-term in emacs send when you press DEL? What is stty erase configured to?
15:45:13
pjb
megachombass: the point of the exercise, is to make you write lisp from scratch! How would you learn lisp otherwise?
15:48:47
Bike
eh. writing a vm in an unfamiliar language with, apparently, zero support, is a bit much. maybe you could ask your classmates what resources they used.
15:52:15
megachombass
we were 3 classmates on this project, other 2 literally left me alone coz they abandonated
15:52:16
jmercouris
Maybe I got lucky, but I think that generally people in this world are good, if not at least neutral
15:52:43
Bike
i'm just saying, you have no idea what you're doing. you've stated as much. you were not prepared. either your class is doing poorly in general because of poor instruction, or you weren't paying attention. in the former case, you need to talk to the department.
15:53:04
pjb
megachombass: try: (let ((*print-circle* nil)) (pprint (macroexpand '(defstruct vm r0 r1 r2 r3 pc sp fp))))
15:53:28
jmercouris
I'm almost of the opinion that you should not attempt to complete the project and instead focus on getting an extension, or going through the appropriate channels as Bike suggested
15:54:21
pjb
It is assumed that students at university level be autonomous. Basically, teachers say: learn this. and the student go and learn this.
15:55:04
pjb
Foremost, when they already know 4 other this that are like it, and when there are a lot of resources on the internet and in libraries about it, and when learning this mainly involves writing programs in this language…
15:55:23
jmercouris
pjb: I guess this is probably true in France, and the comments are in French, so I assume this student is also French, so you're probably right, in the US it is a different story
15:55:36
jmercouris
in the US we pay a lot of money for education, and we expect that the teachers teach
15:55:39
pjb
There's no need for a boring teacher reading the tutorial aloud. You can use your TextToSpeak app for that.
15:56:19
pjb
On the other hand, if the student doesn't start early, he cannot come to the teacher with his questions soon enough.
15:56:54
megachombass
well, pprint prints alot of stuff, but i guess nothing interesting as ive not set values to it
15:58:20
pjb
therefore you can remove the old vm-r0 from your sources. And all the similar function that have been generated by the defstruct macro.
16:00:13
pjb
So, in lisp, defstruct does more than a C struct. In C, it only declares a type. In Common Lisp, it also defines utility functions: a constructor, a copier, accessors, a serializer and deserializer.
16:01:25
megachombass
with the (let ((*print-circle* nil)) (pprint (macroexpand '(defstruct vm r0 r1 r2 r3 pc sp fp)))) ? or that is just for me to se in lisp interpreter whats going on?
16:01:59
megachombass
okey so i just put defstruct and load the file, and it should add functions to my source
16:02:19
pjb
but erase the old functions such as vm-r0, otherwise they will override the one defined by the defstruct.
16:05:33
megachombass
https://codeshare.io/GkwJYA <== all changes i apply on my sourcecode are updated there
16:05:52
megachombass
ive added the struct def and the start of my file, loaded file, still everything the same on source
16:06:20
pjb
DeuxiemeElement is not an abstraction. There is already first, second, third, … tenth in CL.
16:08:05
pjb
An instruction is not composed of elements. It's composed of an operand, an argument and a second argument.
16:08:36
pjb
Elements are what are in list, and Lisp, being a List Processing language, already provide functions to operate on lists such as first rest member second third etc.
16:09:58
pjb
Clearly, it was intended for you to learn lisp and program the assignment during the Christmas holidays.
16:16:36
jackdaniel
weaseling from assignments isn't a noble thing to do ,) especially that it misses the point
16:16:55
jackdaniel
assignments are not something to be finished but rather a mean to a goal of understanding something
16:20:53
shrdlu68
Back in school I used to hate the exam season because it meant I could code less. Also because the libraries, usually serene hide-outs, would see a sudden surge in visitors.
16:24:08
jackdaniel
on the other hand being honest that it is an assignment is much better than trying to lie that it is not
16:31:40
megachombass
(defun make-vm (&optional (vm 'vm) (tmem 10000)) ;;ca initialise les "variables" (setf (vm-vm) vm)
16:31:56
megachombass
it says *** - EVAL/APPLY: Too few arguments (1 instead of at least 2) given to (SETF VM-VM)
16:38:14
pjb
(vm-SP) must be written (vm-SP vm), and (setf (vm-SP vm) (+ (vm-SP vm) 1)) can be written (incf (vm-sp vm))
16:42:03
pjb
For fields needing more complex initialization, you can wrap another constructor: https://codeshare.io/2pzoLX
16:44:44
pjb
megachombass: merge resetmemory with make-vm-with-memory-size: https://codeshare.io/2pzoLX
16:47:10
pjb
Then: (make-vm-with-memory-size 100) --> #S(vm :r0 0 :r1 0 :r2 0 :r3 0 :pc 99 :lc 99 :sp 100 :fp 0 :dpp 0 :de 0 :dpg 0 :taille 100 :memtab #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) :etiq #<hash-table :test eql size 0/107 #x302005C1DC9D> :etiqnr #<hash-table :test eql size
16:48:05
pjb
What prints #S(vm …) is the "serializer", the printer function that is defined by defstruct for the structure. This syntax can be read back. (But #< cannot, so you would have to use #.(make-hash-table) instead.
16:48:53
pjb
You need to update the code using make-vm, of course. For example: https://codeshare.io/2pzoLX
16:50:42
pjb
(list (make-vm-with-memory-size 4) (make-vm-with-memory-size 10)) #| --> (#S(vm :r0 0 :r1 0 :r2 0 :r3 0 :pc 3 :lc 3 :sp 100 :fp 0 :dpp 0 :de 0 :dpg 0 :taille 4 :memtab #(0 0 0 0) :etiq #<hash-table :test eql size 0/31 #x302005C7E56D> :etiqnr #<hash-table :test eql size 1/31 #x302005C7E16D>) #S(vm :r0 0 :r1 0 :r2 0 :r3 0 :pc 9 :lc 9 :sp 100 :fp 0 :dpp 0 :de 0 :dpg 0 :taille 10 :memtab #(0 0 0 0 0 0 0 0 0 0) :etiq #<hash-table :tes
16:50:42
pjb
size 0/31 #x302005C7DC5D> :etiqnr #<hash-table :test eql size 1/31 #x302005C7D85D>)) |#
16:53:04
pjb
If you wanted to simulate a multi-processor system, you could even create multiple VM with the same memory! :-)
16:54:04
pjb
megachombass: notice that the vm-taille field is useless, since (vm-taille vm) == (length (vm-memtab vm))
16:54:48
pjb
If you need to use it, you can (defun vm-taille (vm) (length (vm-memtab vm))) and remove it from the field. This way you would ensure that it is always automatically the right value.
17:01:21
megachombass
but why call make-vm in make-vm-with size if the VM have already default values when creating the struct?
17:15:20
megachombass
pjb: hit me up when you're back, since ive literally fked up my source code and cant manage to make coexist your make-vm-with-memory-size with the rest of the code
17:30:06
flip214
does CL-SQL include some function that, given the database structure and two tables A and B, gives a query relating both, even across multiple joins?
17:30:33
flip214
I'm aware that such a join might be possible across multiple ways, so returning a list of queries would be okay, too.
17:31:09
flip214
The usecase is for some generic web frontend - given a user, show the records that may be accessed (by relations to the user record)
17:36:10
ghast
hello. sbcl question. is it okay to do (sb-ext:save-lisp-and-die "core") a proper way to get a core file for SBCL ? it seems to fail after loading cl-json into the image
17:37:36
flip214
http://quickdocs.org/clsql-orm/ is the sentence "Of course, database-type has to be :postgresql." still true, or are other DBs supported as well?
17:40:16
phoe
flip214: a brief look at the source states that there is code for handling several databases
17:41:05
flip214
phoe: thanks, I found a clsql-mysql-introspect, too... I'd need something for Oracle, though.
17:42:03
flip214
hmmm... can you do an upgrade? that's a bit old already, not sure whether someone has that version around to do investigations
17:45:25
pjb
megachombass: EVAL/APPLY: Trop d'arguments pour MAKE-VM. probably comes from the fact that you overrode the make-vm function defined by defstruct!
17:46:06
phoe
ghast: this is an error in SAVE-LISP-AND-DIE, seems like something very internal to SBCL.
17:47:59
megachombass
pjb: yes, i noticed i didnt errase my make-vm. now the thing is, it cant make the hashtables as its says etiq and etiqnr are not symbols: :ETIQ #S(HASH-TABLE :TEST FASTHASH-EQL) :ETIQNR #S(HASH-TABLE :TEST FASTHASH-EQL (NB . 0))) is not a symbol
17:48:53
ghast
some weird combination of using cl-json before dumping the image just makes my sbcl go mad. i'll try updating sbcl later and see what happens
17:49:25
pjb
megachombass: the reason why call make-vm in make-vm-with-memory-size is to allocate the memtab abd the hash-tables. You're right that this can be avoided, but as I said, it would require more sophisticated lisping such as https://codeshare.io/2pzoLX ; but since you're a newbie, I wanted to preset the simplier code.
17:50:01
pjb
megachombass: with that new defstruct, you don't need make-vm-with-memory-size, and instead, you can call (make-vm) for a default size of 1000 or (make-vm 10000) to specify the size.
17:51:51
pjb
megachombass: when you have errors saying that a list is not a symbol, it probably comes from an error in the parentheses.
17:54:29
pjb
megachombass: in emacs, you can type C-M-< M-x replace-regexp (get vm :\([a-z0-9]*\)) RET (vm-\1 vm) RET to replace the old calls to the new calls.
18:06:09
zazzerino
it should select the entire buffer, then you can run M-x replace-regexp ... on the selected region
18:09:14
pjb
megachombass: when you launch emacs, it tells you to read the tutorial by typing Control-h t. In the tutorial, you will learn what C-M-< means.
18:10:57
pjb
In emacs, key chords are given symbolically, because the actual mapping vary and is configurable.
18:12:28
pjb
The truth is that is the command: beginning-of-buffer You can run this command by typing: M-x beginning-of-buffer RET
18:13:18
pjb
C-h w beginning-of-buffer RET or read the whole documentation with C-h f beginning-of-buffer RET
18:15:51
megachombass
seems he wants to replace (get vm :\([a-z0-9]*\)) RET (vm-\1 vm) RET with something
18:23:12
megachombass
and thing is this todo list overrides my source code, and dont know how to go backwards
18:24:31
pjb
megachombass: you can manipulate windows with C-x 1, C-x 2, C-x 3, C-x 0, C-x o and C-x B and C-x b
18:33:27
megachombass
im really gonna learn more about emacs and lisp after my project. i just cant accept to feel so dumb
18:41:41
pjb
It's important to keep all the definition relevant to a single abstraction together, so you can easily keep consistency, when you make such modifications.
18:48:51
megachombass
:ETIQ #S(HASH-TABLE :TEST FASTHASH-EQL (FIBO . 9999)) :ETIQNR #S(HASH-TABLE :TEST FASTHASH-EQL (NB . 0))> is not a symbol
19:17:04
makomo
can very much agree with what pjb said, having a test suite to run after you make a change is great
19:26:43
zazzerino
sure, the beautifully named "Scheme Coin". https://gist.github.com/BusFactor1Inc/8a4dd842fdab81d84cfa8138a56b1725
19:30:35
zazzerino
Also, there's a list dialect that targets the ethereum platform. It's called "Pyramid Scheme". http://www.michaelburge.us/2017/11/28/write-your-next-ethereum-contract-in-pyramid-scheme.html
20:17:41
borei
i have quick question abt function naming. Does lisp provide some sort of function overload (like it's done in C++ - one name, but different signature). I can achive this functionality using &rest and &key options, but it will require to create some additional logic in the function itself
20:18:12
megachombass
pjb: well, ive got ride of almost all warnings . one reduntant it says WARNING: in EXEC in lines 109..144 : CASE : Le choix QUOTE se répète: (CASE INSTRUCT ('MOVE (MOVE VM PARAMETRE PARAMETRE2)) ('INCR (OPERATIONVM VM '+ '(:DIESE 1) PARAMETRE)) ('DECR (OPERATIONVM VM '- '(:DIESE 1) PARAMETRE)) ('ADD (OPERATIONVM VM '+ PARAMETRE PARAMETRE2)) ..........etc
20:18:59
phoe
also, in Lisp, you can pass an argument of any type to a function - that's the "ultimate" function overloading.
20:19:21
phoe
If you want efficiency, you can use compiler macros, that can check types at compile-time and generate more efficient code for known types.
20:19:46
phoe
and generic dispatch, which is yet another, object-oriented way of function overloading.
20:20:34
phoe
&key and &rest are yet another way of overloading, this time with relation to argument arity.
20:21:17
borei
ok, here is example - function translate, it can take one argument r (as a vector), or x, ,y ,z - numbers
20:24:18
megachombass
In exec: Duplicate keyform quote in case statement. this one i dont see whats the problem. seems he think the case is the same
20:25:02
phoe
borei: with a compiler macro for most optimized cases, like an argument of type (simple-array (unsigned-byte 8) (3))
20:28:21
aeth
If you're using a supported implementation you can use specialization-store to do type-based dispath that handles types at compile time. https://github.com/markcox80/specialization-store/
20:29:44
megachombass
pjb: https://codeshare.io/GkwJYA so, this should only give the the quote error duplicate and the setf's
20:35:24
pjb
megachombass: it's better to write ((move) …) because if you wanted to test for nil, you would have to put the parentheses ((nil) …) since nil is the same as () and (nil …) would be (() …) ie. an empty list of constant, so the … would never be evaluated.
20:46:43
megachombass
pjb: :ETIQ #S(HASH-TABLE :TEST FASTHASH-EQL (FIBO . 9999)) :ETIQNR #S(HASH-TABLE :TEST FASTHASH-EQL (NB . 0))> is not a symbol
20:54:10
pjb
megachombass: ok. So now apply the instructions in the debugging tutorial I gave you 3 days ago.
21:03:49
pjb
megachombass: in your case, since you have a VM with a big vector, you may want to (setf *print-length* 10) so that it doesn't prints thousands of 0s from your memtab.
21:14:28
pjb
When you read the source of move, you see that you've left an occurence of GET: (setf (get vm adr) res)
21:17:00
megachombass
but i dont know how you can figure out that move was the problem on that backtrace
21:17:07
Shinmera
_death: I assume that optional argument mishap I introduced wasn't what confused you initially though, so to ask again: what was confusing about plaster-new?
21:18:27
pjb
megachombass: the last system function gives you a hint, it's system::%put, if you know that it's what's called when you use (setf gethash).
21:18:42
Shinmera
borei: Declare promises to the compiler that the variable will have that specific type. if it does not the program can burn your house down.
21:19:54
pjb
(progn (check-type i integer) (cond ((< i 10) (throw 'done)) ((> i 15) (quit))) (locally (declare (i (integer 10 15))) (foo i)))
21:20:50
_death
Shinmera: the first time I tried it, it put up a buffer but I entered "lisp" for type, I missed the C-x C-s message and tried to use C-c C-c (which is what I'd expect).. I think I did end up submitting the entry somehow, but because the type was nonexistent it failed, and the second time I tried to use it, it didn't go the same way (I wasn't presented with an empty buffer) and so I resorted to using the paste-region function
21:24:37
_death
Shinmera: C-c C-c -> submit and C-c C-k -> cancel is what I'm used to from writing mails.. magit also used to have these bindings, though it changed submit (in the commit message buffer) to C-x # at some point..
21:31:45
aeth
borei: declare behaves like check-type in SBCL when safety != 0 and assumes types when safety == 0. It is slightly smaller in disassembly because it doesn't let you replace the value with a valid value iirc. It might assume the type at all safety levels in some implementations. It looks like CCL ignores it and ECL ignores it. This would be hard to test on all implementations, though, because some might behave differently at different optimi
21:36:35
aeth
(It's also possible that they might behave differently at the REPL than with a compiled file, too.)
21:38:48
Shinmera
Regardless of what the implementation does, you should /NOT/ use declare to check types.
21:39:03
Shinmera
It's not about what it does, it's about what it's designed for and what it reads as.
21:40:19
stylewarning
I tried to implement this type of behavior with WITH-EXPECTATIONS https://bitbucket.org/tarballs_are_good/policy-cond
21:41:20
aeth
It definitely looks like there's three possibilities: (1) declaration ignored, (2) declaration checked, (3) declaration assumed. SBCL with (not (zeorp safety)) seems to offer #2, #1 seems to be the most common, and #3 is the risky thing you definitely do NOT want to happen but that could happen.
21:41:58
Shinmera
aeth: Again it doesn't matter. For readability alone you should not use declarations for type checks.
21:42:12
pjb
For example, in (let ((x (foo))) (declare x integer) (+ x 1)) you're telling the compiler that foo returns an integer. So that the + in (+ x 1) can perform integer addition without testing whether x is a ratio, a floating point or a complex, and without signaling a type error for something else.
21:42:37
pjb
But if foo returns something else than an integer, then you've LIED to the compiler and it will crash, like a vulgar C program!
21:43:45
pjb
On the other hand, in (let ((x (foo))) (check-type x integer) (+ x 1)) foo can return anything. But check-type will ensure that x is an integer after it's executed. Then the compiler can make the same assuption, but now, if foo returns something else than n integer, check-type will interact with the user to ensure that x is an integer or signal a type-error.
21:46:11
stylewarning
I feel like advanced users of Lisp in #lisp all too often reiterate basic facts about Lisp to one another, without actually intending to convey or share info about Lisp, but rather to just (re)broadcast facts that are easy to be opinionated about.
21:47:29
Bike
is that an example of itself? is this an example? sociologists haven't yet worked it out
23:06:52
jmercouris
here's a small snippet illustrating: https://gist.github.com/5cbceb59e8ff6f535a8eb2ca65423051
23:08:24
jmercouris
Here's the super bizzare part, converting the :h1 to a :a removes the extra spaces
23:10:57
pjb
Well, obviously I wrote my own html generator, so I don't have those problems… :com.informatimago.common-lisp.html-generator.html
23:11:53
jmercouris
|3b|: How do I do that? is that some config during compilation or is there a command?
23:11:57
|3b|
ACTION doesn't remember if cl-who does indentation the correct-but-ugly way or not, doesn't look like it from examples
23:13:17
|3b|
ACTION notes that including the generated html along with some indication of what you think is wrong with it in the question might get you better answers
23:13:19
jmercouris
I'll just make it an anchor for now that jumps down to the "features" section of the page :D
23:15:32
megachombass
i really dont like the LOC syntax in his asem code, really doesnt represent anything
23:16:32
megachombass
because i belive teacher is going to write some asm by hand (as i dont have a compiler to give to him), and gonna wonder wtf (move (LOC -1 0) :R0) does represent
23:19:29
jmercouris
I just recently forked site-generator, and I didn't touch that part of the code yet
23:20:59
|3b|
one is the variable/binding while other is the value when called, or something like that
23:21:22
|3b|
ACTION wouldn't be surprised if others define them differently though, naming is hard :)
23:21:29
jmercouris
Anyways very interesting, I don't see with-output-to-html anywhere in the codebase
23:24:18
|3b|
to indent html 'correctly', your html should look like ><a instead of <a>, with the indentation inside tags
23:29:57
pjb
megachombass: well, virtual machine can be anything. But if you make a machine with a PC, a SP, and 4 registers holding each integers or even words (integers modulo 2^p), usually the instructions are themselves encoded into integers. Here you have something more ressembling an interpreter of an assembler, than a virtual machine. I don't know if that was specified or not, but perhaps you would have wanted to make it more like a
23:29:57
pjb
micro-processor. The example of virtual machine I gave you the url of was like that. The assembler converted the program into a sequence of byte, and the virtual machine interpreted those bytes.
23:31:15
pjb
megachombass: the reason why it's a good thing is that it allows the programm running on this virtual machine to modify itself. Since you only have operations to deal with integers, and none to deal with lists such as (LOC -1 0), in the current VM you cannot write a program generating a program containing references to local variables or parameters!
23:32:05
pjb
megachombass: (your current file only contains a dash, that's all). https://codeshare.io/GkwJYA
23:34:40
pjb
At this point, the following quote comes to mind: "You don't want to sell me death sticks. You want to go home and rethink your life." u
23:36:18
megachombass
ye, test prints the load machine contennt and at the end returns 5 (result of (fibo 5)
23:37:48
megachombass
as i havent even finished with the VM, and prolly will never have time to make the compiler for tomorrow, i needed some code to work with
23:39:50
pjb
megachombass: since the lisp compiler produces a sexp, you can just quote it and use it directly!
23:46:19
pjb
You don't need to read it yourself from the string! Just write (let ((fibo1 '((entreeprocedure) (@ foo) ...)) (fibo2 '((move …) …))) …)
23:48:50
pjb
Notice that - is a special variable in lisp that is bound to the form being evaluated in the REPL. It's NIL elsewhere.
23:49:34
pjb
One can therefore have fun by adding lines of: - - - - - - - - - - - - - - - - - - - - - - - - in lisp sources…
23:50:33
pjb
For more fun, you can also use + + + + or ++ ++ ++ or +++ +++ +++ +++ or * * * * * or ** ** ** or *** *** *** *** or / / / / or // // // or /// /// /// or any combination such as + - + - + - + etc.
0:05:07
megachombass
pjb: so yeah, as said before, only request are is to have a VM that reads compiled fibo and fact
0:06:40
pjb
megachombass: as I said a few days ago, my suggestions are here: http://informatimago.com/articles/usenet.html#Compilation
0:08:10
pjb
megachombass: in particular, Toy Language Byte Code Compiler. https://groups.google.com/forum/#!msg/comp.lang.lisp/QMakibYYZRg/fgQulr5b4BwJ shows both a compiler to lap assembler, a lap assembler to VM byte code, and the VM.
0:08:52
pjb
megachombass: Compile to a simple VM https://groups.google.com/forum/#!msg/comp.lang.lisp/HqV4B5aoj-c/yI4_av1C6KUJ is another example.
0:09:56
pjb
megachombass: notice at the bottom of the post, how a call to (assemble (compile-program …)) --> #(0 0 6 0 42 0 0 1 4 25 0 2 0 0 2 4 21 0 1 6 5 0 2 6 5 0 3 6 0 4 6 7)
0:16:17
megachombass
well, by perfect in my case is : " does essentially the same as the already existing code, but without beeing the existing code. make a change to the (move (loc - 1 0) :RO) that does weird operations with the FP that i cant explain myself. maybe do some functionallity changes on the VM, that can still load and execute the asm code without changing the asm code given as param (exept for the loc thing))"
0:17:38
megachombass
pjb: btw, i will never be thankfull enough for the help you giving me. really, my university career depends on this, and having people really passionated of progamming, whiling to spend their time on newbies like me, its beatifull
0:17:55
megachombass
hope one day, when i will be senior dev, i will always have an irc open to do the same
0:20:54
ebrasca
I like someone explain me how to port mezzano to POWER9 cpu architecture and talos II.
0:21:57
pjb
megachombass: how many of those tutorials have you read? https://www.cliki.net/Online%20Tutorial
0:22:13
megachombass
specially ive been acepted on a internship in japan for this summer, where i will work on some android dev and web services based on REST
0:22:37
pjb
And basically, they're only about Common Lisp, we've not started a list about Lisp in general!
0:23:03
pjb
megachombass: great. Learn Japanese well, so you may be able to read robotics and AI papers!
0:23:44
pjb
and all those nice japanese lisp projects: https://github.com/suguru03/made-in-japan/blob/master/docs/Common%20Lisp.md
0:25:51
megachombass
he told us friday that the most important was to have a compiler that compiles fibo and fact. i told him "we" only had a VM he said well, you're kinda fked, and that we had untill sunday to send him our work